From e939a427fe350c5ca08d161486fc591cacae489c Mon Sep 17 00:00:00 2001 From: Nilambari Date: Thu, 29 Mar 2018 15:38:43 -0700 Subject: [PATCH 1/2] #1443089: Generate sdk-for-net artifacts from Networking Swagger Network-2018-02-01 branch --- .../ApplicationGatewaysOperations.cs | 130 +- .../ApplicationSecurityGroupsOperations.cs | 50 +- .../AvailableEndpointServicesOperations.cs | 10 +- .../BgpServiceCommunitiesOperations.cs | 10 +- .../Generated/ConnectionMonitorsOperations.cs | 70 +- .../DdosProtectionPlansOperations.cs | 1411 +++++++++++ ...DdosProtectionPlansOperationsExtensions.cs | 361 +++ .../DefaultSecurityRulesOperations.cs | 20 +- ...essRouteCircuitAuthorizationsOperations.cs | 40 +- ...xpressRouteCircuitConnectionsOperations.cs | 773 ++++++ ...eCircuitConnectionsOperationsExtensions.cs | 305 +++ .../ExpressRouteCircuitPeeringsOperations.cs | 40 +- .../ExpressRouteCircuitsOperations.cs | 110 +- ...sRouteCrossConnectionPeeringsOperations.cs | 1108 +++++++++ ...sConnectionPeeringsOperationsExtensions.cs | 339 +++ .../ExpressRouteCrossConnectionsOperations.cs | 2163 +++++++++++++++++ ...uteCrossConnectionsOperationsExtensions.cs | 703 ++++++ .../ExpressRouteServiceProvidersOperations.cs | 10 +- .../IDdosProtectionPlansOperations.cs | 237 ++ ...xpressRouteCircuitConnectionsOperations.cs | 189 ++ ...sRouteCrossConnectionPeeringsOperations.cs | 218 ++ ...IExpressRouteCrossConnectionsOperations.cs | 444 ++++ .../Generated/INetworkManagementClient.cs | 25 + .../IVirtualNetworkGatewaysOperations.cs | 120 + .../Generated/InboundNatRulesOperations.cs | 40 +- ...adBalancerBackendAddressPoolsOperations.cs | 20 +- ...ancerFrontendIPConfigurationsOperations.cs | 20 +- ...oadBalancerLoadBalancingRulesOperations.cs | 20 +- ...LoadBalancerNetworkInterfacesOperations.cs | 10 +- .../Generated/LoadBalancerProbesOperations.cs | 20 +- .../Generated/LoadBalancersOperations.cs | 60 +- .../LocalNetworkGatewaysOperations.cs | 50 +- .../Models/CircuitConnectionStatus.cs | 23 + .../Generated/Models/DdosProtectionPlan.cs | 101 + .../Models/ExpressRouteCircuitConnection.cs | 137 ++ .../Models/ExpressRouteCircuitPeering.cs | 36 +- .../Models/ExpressRouteCircuitReference.cs | 50 + .../Models/ExpressRouteCrossConnection.cs | 162 ++ .../ExpressRouteCrossConnectionPeering.cs | 222 ++ ...sRouteCrossConnectionRoutesTableSummary.cs | 84 + ...ConnectionsRoutesTableSummaryListResult.cs | 65 + .../Models/ExpressRoutePeeringState.cs | 22 + ...ringType.cs => ExpressRoutePeeringType.cs} | 4 +- .../Generated/Models/IpsecPolicy.cs | 11 +- .../Generated/Models/PfsGroup.cs | 2 + .../Generated/Models/VirtualNetwork.cs | 28 +- .../Models/VpnClientConfiguration.cs | 12 +- .../Models/VpnClientIPsecParameters.cs | 169 ++ ...workInterfaceIPConfigurationsOperations.cs | 20 +- ...NetworkInterfaceLoadBalancersOperations.cs | 10 +- .../Generated/NetworkInterfacesOperations.cs | 90 +- .../Generated/NetworkManagementClient.cs | 40 +- .../NetworkSecurityGroupsOperations.cs | 60 +- .../Generated/NetworkWatchersOperations.cs | 170 +- .../Generated/Operations.cs | 16 +- .../Generated/PacketCapturesOperations.cs | 60 +- .../Generated/PublicIpAddressesOperations.cs | 66 +- .../Generated/RouteFilterRulesOperations.cs | 50 +- .../Generated/RouteFiltersOperations.cs | 60 +- .../Generated/RouteTablesOperations.cs | 60 +- .../Generated/RoutesOperations.cs | 40 +- .../SdkInfo_NetworkManagementClient.cs | 84 +- .../Generated/SecurityRulesOperations.cs | 40 +- .../Generated/SubnetsOperations.cs | 40 +- .../Generated/UsagesOperations.cs | 10 +- ...tualNetworkGatewayConnectionsOperations.cs | 80 +- .../VirtualNetworkGatewaysOperations.cs | 617 ++++- ...tualNetworkGatewaysOperationsExtensions.cs | 192 ++ .../VirtualNetworkPeeringsOperations.cs | 40 +- .../Generated/VirtualNetworksOperations.cs | 80 +- .../Microsoft.Azure.Management.Network.csproj | 12 +- .../Properties/AssemblyInfo.cs | 2 +- .../Network.Tests/Network.Tests.csproj | 3 + .../Network/Network.Tests/Tests/TestHelper.cs | 12 +- .../_metadata/network_resource-manager.txt | 6 +- 75 files changed, 11375 insertions(+), 839 deletions(-) create mode 100644 src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs rename src/SDKs/Network/Management.Network/Generated/Models/{ExpressRouteCircuitPeeringType.cs => ExpressRoutePeeringType.cs} (85%) create mode 100644 src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs diff --git a/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs index 6504194b7b24..38a762b95eb3 100644 --- a/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs @@ -112,11 +112,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -126,7 +129,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -137,9 +139,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -349,11 +351,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -372,9 +376,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -527,11 +531,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +546,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -548,9 +554,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -774,11 +780,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// public async Task> ListAvailableWafRuleSetsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -786,7 +795,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAvailableWafRuleSets", tracingParameters); } @@ -795,9 +803,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -950,11 +958,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// public async Task> ListAvailableSslOptionsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -962,7 +973,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslOptions", tracingParameters); } @@ -971,9 +981,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1126,11 +1136,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// public async Task>> ListAvailableSslPredefinedPoliciesWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1138,7 +1151,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSslPredefinedPolicies", tracingParameters); } @@ -1147,9 +1159,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1305,6 +1317,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// public async Task> GetSslPredefinedPolicyWithHttpMessagesAsync(string predefinedPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1313,7 +1329,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1321,7 +1336,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("predefinedPolicyName", predefinedPolicyName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSslPredefinedPolicy", tracingParameters); @@ -1332,9 +1346,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{predefinedPolicyName}", System.Uri.EscapeDataString(predefinedPolicyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1498,11 +1512,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1512,7 +1529,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1523,9 +1539,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1685,11 +1701,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1700,7 +1719,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1711,9 +1729,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1911,11 +1929,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1926,7 +1947,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1937,9 +1957,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2109,11 +2129,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2123,7 +2146,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } @@ -2134,9 +2156,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2282,11 +2304,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2296,7 +2321,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } @@ -2307,9 +2331,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2463,11 +2487,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2477,7 +2504,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); @@ -2489,9 +2515,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { diff --git a/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs index 716d0e879796..d8032534ea26 100644 --- a/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs @@ -112,11 +112,14 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -126,7 +129,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -137,9 +139,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -318,11 +320,14 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -330,7 +335,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -339,9 +343,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -501,11 +505,14 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -514,7 +521,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -524,9 +530,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -690,11 +696,14 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -704,7 +713,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -715,9 +723,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -874,11 +882,14 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -889,7 +900,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -900,9 +910,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs index 80f88e6470e9..a1b9196d306c 100644 --- a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs @@ -83,11 +83,14 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -96,7 +99,6 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -106,9 +108,9 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs b/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs index d0c1f993c246..8233cc31aec7 100644 --- a/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs @@ -76,11 +76,14 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -88,7 +91,6 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -97,9 +99,9 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs index fca9750a3df4..967bc787d9da 100644 --- a/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs @@ -125,11 +125,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -140,7 +143,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -152,9 +154,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -421,11 +423,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -435,7 +440,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -446,9 +450,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -633,11 +637,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -649,7 +656,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -661,9 +667,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -858,11 +864,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -873,7 +882,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -885,9 +893,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1040,11 +1048,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1055,7 +1066,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } @@ -1067,9 +1077,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1222,11 +1232,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1237,7 +1250,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } @@ -1249,9 +1261,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1407,11 +1419,14 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionMonitorName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1422,7 +1437,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("connectionMonitorName", connectionMonitorName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginQuery", tracingParameters); } @@ -1434,9 +1448,9 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) _url = _url.Replace("{connectionMonitorName}", System.Uri.EscapeDataString(connectionMonitorName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs new file mode 100644 index 000000000000..bec763eb3437 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs @@ -0,0 +1,1411 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DdosProtectionPlansOperations operations. + /// + internal partial class DdosProtectionPlansOperations : IServiceOperations, IDdosProtectionPlansOperations + { + /// + /// Initializes a new instance of the DdosProtectionPlansOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DdosProtectionPlansOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs new file mode 100644 index 000000000000..f652bac117b6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs @@ -0,0 +1,361 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DdosProtectionPlansOperations. + /// + public static partial class DdosProtectionPlansOperationsExtensions + { + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static void Delete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + operations.DeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlan Get(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + return operations.GetAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + public static DdosProtectionPlan CreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IDdosProtectionPlansOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IDdosProtectionPlansOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IDdosProtectionPlansOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static void BeginDelete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + operations.BeginDeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + public static DdosProtectionPlan BeginCreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IDdosProtectionPlansOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IDdosProtectionPlansOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs index 989d655e1d6a..a576a91d45b8 100644 --- a/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs @@ -90,11 +90,14 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -291,11 +293,14 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "defaultSecurityRuleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("defaultSecurityRuleName", defaultSecurityRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -318,9 +322,9 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) _url = _url.Replace("{defaultSecurityRuleName}", System.Uri.EscapeDataString(defaultSecurityRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index da39ec771969..78f82ff974b8 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -123,11 +123,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -138,7 +141,6 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -150,9 +152,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -348,11 +350,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -373,9 +377,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -547,11 +551,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -562,7 +569,6 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -574,9 +580,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -740,11 +746,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -756,7 +765,6 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("authorizationParameters", authorizationParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -768,9 +776,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs new file mode 100644 index 000000000000..97fc2763b92d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -0,0 +1,773 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCircuitConnectionsOperations operations. + /// + internal partial class ExpressRouteCircuitConnectionsOperations : IServiceOperations, IExpressRouteCircuitConnectionsOperations + { + /// + /// Initializes a new instance of the ExpressRouteCircuitConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (expressRouteCircuitConnectionParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteCircuitConnectionParameters"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("expressRouteCircuitConnectionParameters", expressRouteCircuitConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(expressRouteCircuitConnectionParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(expressRouteCircuitConnectionParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..6877d9495bd0 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs @@ -0,0 +1,305 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExpressRouteCircuitConnectionsOperations. + /// + public static partial class ExpressRouteCircuitConnectionsOperationsExtensions + { + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static void Delete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + operations.DeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static ExpressRouteCircuitConnection Get(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + return operations.GetAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + public static ExpressRouteCircuitConnection CreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + public static void BeginDelete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + operations.BeginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + public static ExpressRouteCircuitConnection BeginCreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs index c23f10166e04..725473cfaab6 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -122,11 +122,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -137,7 +140,6 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -149,9 +151,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -347,11 +349,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +366,6 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -372,9 +376,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -545,11 +549,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +567,6 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -572,9 +578,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -742,11 +748,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { peeringParameters.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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -758,7 +767,6 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("peeringParameters", peeringParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -770,9 +778,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs index c47efc95f7fb..2d6e7fdc0d43 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs @@ -112,11 +112,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -126,7 +129,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -137,9 +139,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -444,11 +446,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -458,7 +463,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); } @@ -469,9 +473,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -645,11 +649,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -660,7 +667,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); } @@ -672,9 +678,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -834,11 +840,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -847,7 +856,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -857,9 +865,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1012,11 +1020,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1024,7 +1035,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -1033,9 +1043,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1199,11 +1209,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1213,7 +1226,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1224,9 +1236,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1383,11 +1395,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1398,7 +1413,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1409,9 +1423,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1609,11 +1623,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1624,7 +1641,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1635,9 +1651,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1825,11 +1841,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1841,7 +1860,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } @@ -1854,9 +1872,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2038,11 +2056,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2054,7 +2075,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } @@ -2067,9 +2087,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2251,11 +2271,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2267,7 +2290,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } @@ -2280,9 +2302,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs new file mode 100644 index 000000000000..aac269206e56 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -0,0 +1,1108 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionPeeringsOperations operations. + /// + internal partial class ExpressRouteCrossConnectionPeeringsOperations : IServiceOperations, IExpressRouteCrossConnectionPeeringsOperations + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionPeeringsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (peeringParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); + } + if (peeringParameters != null) + { + peeringParameters.Validate(); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("peeringParameters", peeringParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(peeringParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs new file mode 100644 index 000000000000..3e315c1d307a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExpressRouteCrossConnectionPeeringsOperations. + /// + public static partial class ExpressRouteCrossConnectionPeeringsOperationsExtensions + { + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + public static IPage List(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName) + { + return operations.ListAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static void Delete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + operations.DeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCrossConnectionPeering Get(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + return operations.GetAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + public static ExpressRouteCrossConnectionPeering CreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static void BeginDelete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + operations.BeginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + public static ExpressRouteCrossConnectionPeering BeginCreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs new file mode 100644 index 000000000000..c7eba6df0579 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -0,0 +1,2163 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionsOperations operations. + /// + internal partial class ExpressRouteCrossConnectionsOperations : IServiceOperations, IExpressRouteCrossConnectionsOperations + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (crossConnectionParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionParameters"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("crossConnectionParameters", crossConnectionParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(crossConnectionParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(crossConnectionParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..17bc4f172ef9 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs @@ -0,0 +1,703 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExpressRouteCrossConnectionsOperations. + /// + public static partial class ExpressRouteCrossConnectionsOperationsExtensions + { + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IExpressRouteCrossConnectionsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IExpressRouteCrossConnectionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + public static ExpressRouteCrossConnection Get(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName) + { + return operations.GetAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + public static ExpressRouteCrossConnection CreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + public static ExpressRouteCrossConnection UpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) + { + return operations.UpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.ListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The cancellation token. + /// + public static async Task ListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.ListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.ListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task ListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + public static ExpressRouteCrossConnection BeginCreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + public static ExpressRouteCrossConnection BeginUpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) + { + return operations.BeginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.BeginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The cancellation token. + /// + public static async Task BeginListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.BeginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.BeginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task BeginListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs index 41597112d234..88e0450dbde0 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs @@ -76,11 +76,14 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -88,7 +91,6 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -97,9 +99,9 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs b/src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs new file mode 100644 index 000000000000..40d3e6001ca5 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs @@ -0,0 +1,237 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DdosProtectionPlansOperations operations. + /// + public partial interface IDdosProtectionPlansOperations + { + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs new file mode 100644 index 000000000000..70e21c0b5de5 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs @@ -0,0 +1,189 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCircuitConnectionsOperations operations. + /// + public partial interface IExpressRouteCircuitConnectionsOperations + { + /// + /// Deletes the specified Express Route Circuit Connection from the + /// specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified Express Route Circuit Connection from the + /// specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Express Route Circuit Connection in the + /// specified express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// circuit connection operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified Express Route Circuit Connection from the + /// specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Express Route Circuit Connection in the + /// specified express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// circuit connection operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs new file mode 100644 index 000000000000..d52ca3ae64c6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs @@ -0,0 +1,218 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionPeeringsOperations operations. + /// + public partial interface IExpressRouteCrossConnectionPeeringsOperations + { + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a peering in the specified + /// ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update + /// ExpressRouteCrossConnection peering operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a peering in the specified + /// ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update + /// ExpressRouteCrossConnection peering operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs new file mode 100644 index 000000000000..6d7b926e744d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs @@ -0,0 +1,444 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionsOperations operations. + /// + public partial interface IExpressRouteCrossConnectionsOperations + { + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the + /// circuit). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised ARP table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the route table summary associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised routes table associated with the + /// express route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised ARP table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the route table summary associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised routes table associated with the + /// express route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs index 1476f94891a7..a4485018ba2a 100644 --- a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs @@ -51,6 +51,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// Client API version. + /// + string ApiVersion { get; } + /// /// Gets or sets the preferred language for the response. /// @@ -79,6 +84,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IApplicationSecurityGroupsOperations ApplicationSecurityGroups { get; } + /// + /// Gets the IDdosProtectionPlansOperations. + /// + IDdosProtectionPlansOperations DdosProtectionPlans { get; } + /// /// Gets the IAvailableEndpointServicesOperations. /// @@ -94,6 +104,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IExpressRouteCircuitPeeringsOperations ExpressRouteCircuitPeerings { get; } + /// + /// Gets the IExpressRouteCircuitConnectionsOperations. + /// + IExpressRouteCircuitConnectionsOperations ExpressRouteCircuitConnections { get; } + /// /// Gets the IExpressRouteCircuitsOperations. /// @@ -104,6 +119,16 @@ public partial interface INetworkManagementClient : System.IDisposable /// IExpressRouteServiceProvidersOperations ExpressRouteServiceProviders { get; } + /// + /// Gets the IExpressRouteCrossConnectionsOperations. + /// + IExpressRouteCrossConnectionsOperations ExpressRouteCrossConnections { get; } + + /// + /// Gets the IExpressRouteCrossConnectionPeeringsOperations. + /// + IExpressRouteCrossConnectionPeeringsOperations ExpressRouteCrossConnectionPeerings { get; } + /// /// Gets the ILoadBalancersOperations. /// diff --git a/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs index 9616d8f83736..88e8b2d6f08b 100644 --- a/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs @@ -403,6 +403,66 @@ public partial interface IVirtualNetworkGatewaysOperations /// Task> GetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec + /// policy for P2S client of virtual network gateway in the specified + /// resource group through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of + /// Virtual Network Gateway P2S client operation through Network + /// resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Get VpnclientIpsecParameters operation retrieves information + /// about the vpnclient ipsec policy for P2S client of virtual network + /// gateway in the specified resource group through Network resource + /// provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a xml format representation for vpn device configuration /// script. /// @@ -715,6 +775,66 @@ public partial interface IVirtualNetworkGatewaysOperations /// Task> BeginGetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec + /// policy for P2S client of virtual network gateway in the specified + /// resource group through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of + /// Virtual Network Gateway P2S client operation through Network + /// resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Get VpnclientIpsecParameters operation retrieves information + /// about the vpnclient ipsec policy for P2S client of virtual network + /// gateway in the specified resource group through Network resource + /// provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all virtual network gateways by resource group. /// /// diff --git a/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs index 42ecbe01a098..3471895bafb5 100644 --- a/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs @@ -90,11 +90,14 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal InboundNatRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -319,11 +321,14 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -334,7 +339,6 @@ internal InboundNatRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("inboundNatRuleName", inboundNatRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -347,9 +351,9 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url = _url.Replace("{inboundNatRuleName}", System.Uri.EscapeDataString(inboundNatRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -552,11 +556,14 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -567,7 +574,6 @@ internal InboundNatRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("inboundNatRuleName", inboundNatRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -579,9 +585,9 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url = _url.Replace("{inboundNatRuleName}", System.Uri.EscapeDataString(inboundNatRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -744,11 +750,14 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -760,7 +769,6 @@ internal InboundNatRulesOperations(NetworkManagementClient client) tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("inboundNatRuleName", inboundNatRuleName); tracingParameters.Add("inboundNatRuleParameters", inboundNatRuleParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -772,9 +780,9 @@ internal InboundNatRulesOperations(NetworkManagementClient client) _url = _url.Replace("{inboundNatRuleName}", System.Uri.EscapeDataString(inboundNatRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs index 1984c949b0ff..dfc9214dcf72 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -90,11 +90,14 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -291,11 +293,14 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "backendAddressPoolName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("backendAddressPoolName", backendAddressPoolName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -318,9 +322,9 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien _url = _url.Replace("{backendAddressPoolName}", System.Uri.EscapeDataString(backendAddressPoolName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index 64e85f6868aa..5a4286fe2a39 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -90,11 +90,14 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -291,11 +293,14 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "frontendIPConfigurationName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("frontendIPConfigurationName", frontendIPConfigurationName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -318,9 +322,9 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient _url = _url.Replace("{frontendIPConfigurationName}", System.Uri.EscapeDataString(frontendIPConfigurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs index ceee87ed195e..0209f03cab69 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -90,11 +90,14 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -291,11 +293,14 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancingRuleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("loadBalancingRuleName", loadBalancingRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -318,9 +322,9 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client _url = _url.Replace("{loadBalancingRuleName}", System.Uri.EscapeDataString(loadBalancingRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs index e0f718e86f2b..95efc5ac5908 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -90,11 +90,14 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs index 04291f63809c..023cb96c1e8d 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs @@ -90,11 +90,14 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -291,11 +293,14 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "probeName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("probeName", probeName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -318,9 +322,9 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) _url = _url.Replace("{probeName}", System.Uri.EscapeDataString(probeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs index c7ce694af70f..97091983a3f6 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs @@ -115,11 +115,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -350,11 +352,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -371,9 +375,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -533,11 +537,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +553,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -556,9 +562,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -722,11 +728,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,7 +745,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -747,9 +755,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -905,11 +913,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +931,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -931,9 +941,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1131,11 +1141,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1146,7 +1159,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1157,9 +1169,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs index b87e2621ace8..ddfb8ba126cb 100644 --- a/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs @@ -123,11 +123,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -137,7 +140,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -148,9 +150,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -357,11 +359,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +375,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -380,9 +384,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -564,11 +568,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -579,7 +586,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -590,9 +596,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -787,11 +793,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -801,7 +810,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -812,9 +820,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -977,11 +985,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -992,7 +1003,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1003,9 +1013,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs b/src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs new file mode 100644 index 000000000000..c0eea9205b43 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for CircuitConnectionStatus. + /// + public static class CircuitConnectionStatus + { + public const string Connected = "Connected"; + public const string Connecting = "Connecting"; + public const string Disconnected = "Disconnected"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs b/src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs new file mode 100644 index 000000000000..3961d284cb2f --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DDoS protection plan in a resource group. + /// + [Rest.Serialization.JsonTransformation] + public partial class DdosProtectionPlan : Resource + { + /// + /// Initializes a new instance of the DdosProtectionPlan class. + /// + public DdosProtectionPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DdosProtectionPlan class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The resource GUID property of the DDoS + /// protection plan resource. It uniquely identifies the resource, even + /// if the user changes its name or migrate the resource across + /// subscriptions or resource groups. + /// The provisioning state of the DDoS + /// protection plan resource. Possible values are: 'Succeeded', + /// 'Updating', 'Deleting', and 'Failed'. + /// The list of virtual networks + /// associated with the DDoS protection plan resource. This list is + /// read-only. + /// A unique read-only string that changes whenever + /// the resource is updated. + public DdosProtectionPlan(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string resourceGuid = default(string), string provisioningState = default(string), IList virtualNetworks = default(IList), string etag = default(string)) + : base(id, name, type, location, tags) + { + ResourceGuid = resourceGuid; + ProvisioningState = provisioningState; + VirtualNetworks = virtualNetworks; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource GUID property of the DDoS protection plan + /// resource. It uniquely identifies the resource, even if the user + /// changes its name or migrate the resource across subscriptions or + /// resource groups. + /// + [JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid { get; private set; } + + /// + /// Gets the provisioning state of the DDoS protection plan resource. + /// Possible values are: 'Succeeded', 'Updating', 'Deleting', and + /// 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the list of virtual networks associated with the DDoS + /// protection plan resource. This list is read-only. + /// + [JsonProperty(PropertyName = "properties.virtualNetworks")] + public IList VirtualNetworks { get; private set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs new file mode 100644 index 000000000000..426291ec728d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs @@ -0,0 +1,137 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Express Route Circuit Connection in an ExpressRouteCircuitPeering + /// resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteCircuitConnection : SubResource + { + /// + /// Initializes a new instance of the ExpressRouteCircuitConnection + /// class. + /// + public ExpressRouteCircuitConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitConnection + /// class. + /// + /// Resource ID. + /// Reference to Express Route + /// Circuit Private Peering Resource of the circuit initiating + /// connection. + /// Reference to Express + /// Route Circuit Private Peering Resource of the peered + /// circuit. + /// /29 IP address space to carve out + /// Customer addresses for tunnels. + /// The authorization key. + /// Express Route Circuit + /// Connection State. Possible values are: 'Connected' and + /// 'Disconnected'. Possible values include: 'Connected', 'Connecting', + /// 'Disconnected' + /// Provisioning state of the circuit + /// connection resource. Possible values are: 'Succeded', 'Updating', + /// 'Deleting', and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ExpressRouteCircuitConnection(string id = default(string), SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string authorizationKey = default(string), string circuitConnectionStatus = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) + : base(id) + { + ExpressRouteCircuitPeering = expressRouteCircuitPeering; + PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + AddressPrefix = addressPrefix; + AuthorizationKey = authorizationKey; + CircuitConnectionStatus = circuitConnectionStatus; + ProvisioningState = provisioningState; + Name = name; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets reference to Express Route Circuit Private Peering + /// Resource of the circuit initiating connection. + /// + [JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] + public SubResource ExpressRouteCircuitPeering { get; set; } + + /// + /// Gets or sets reference to Express Route Circuit Private Peering + /// Resource of the peered circuit. + /// + [JsonProperty(PropertyName = "properties.peerExpressRouteCircuitPeering")] + public SubResource PeerExpressRouteCircuitPeering { get; set; } + + /// + /// Gets or sets /29 IP address space to carve out Customer addresses + /// for tunnels. + /// + [JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix { get; set; } + + /// + /// Gets or sets the authorization key. + /// + [JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey { get; set; } + + /// + /// Gets express Route Circuit Connection State. Possible values are: + /// 'Connected' and 'Disconnected'. Possible values include: + /// 'Connected', 'Connecting', 'Disconnected' + /// + [JsonProperty(PropertyName = "properties.circuitConnectionStatus")] + public string CircuitConnectionStatus { get; private set; } + + /// + /// Gets provisioning state of the circuit connection resource. + /// Possible values are: 'Succeded', 'Updating', 'Deleting', and + /// 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs index ce1c2f53f723..ae1568ed8aa0 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Network.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -33,13 +35,11 @@ public ExpressRouteCircuitPeering() /// Initializes a new instance of the ExpressRouteCircuitPeering class. /// /// Resource ID. - /// The PeeringType. Possible values are: - /// 'AzurePublicPeering', 'AzurePrivatePeering', and - /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - /// 'AzurePrivatePeering', 'MicrosoftPeering' - /// The state of peering. Possible values are: - /// 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - /// 'Enabled' + /// The peering type. Possible values + /// include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + /// The peering state. Possible values include: + /// 'Disabled', 'Enabled' /// The Azure ASN. /// The peer ASN. /// The primary address @@ -63,12 +63,14 @@ public ExpressRouteCircuitPeering() /// resource. /// The IPv6 peering /// configuration. + /// The list of circuit connections + /// associated with Azure Private Peering for this circuit. /// Gets name of the resource that is unique within /// a resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public ExpressRouteCircuitPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), RouteFilter routeFilter = default(RouteFilter), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), string name = default(string), string etag = default(string)) + public ExpressRouteCircuitPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), RouteFilter routeFilter = default(RouteFilter), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), IList connections = default(IList), string name = default(string), string etag = default(string)) : base(id) { PeeringType = peeringType; @@ -88,6 +90,7 @@ public ExpressRouteCircuitPeering() LastModifiedBy = lastModifiedBy; RouteFilter = routeFilter; Ipv6PeeringConfig = ipv6PeeringConfig; + Connections = connections; Name = name; Etag = etag; CustomInit(); @@ -99,17 +102,15 @@ public ExpressRouteCircuitPeering() partial void CustomInit(); /// - /// Gets or sets the PeeringType. Possible values are: - /// 'AzurePublicPeering', 'AzurePrivatePeering', and - /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - /// 'AzurePrivatePeering', 'MicrosoftPeering' + /// Gets or sets the peering type. Possible values include: + /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' /// [JsonProperty(PropertyName = "properties.peeringType")] public string PeeringType { get; set; } /// - /// Gets or sets the state of peering. Possible values are: 'Disabled' - /// and 'Enabled'. Possible values include: 'Disabled', 'Enabled' + /// Gets or sets the peering state. Possible values include: + /// 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "properties.state")] public string State { get; set; } @@ -206,6 +207,13 @@ public ExpressRouteCircuitPeering() [JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig { get; set; } + /// + /// Gets or sets the list of circuit connections associated with Azure + /// Private Peering for this circuit. + /// + [JsonProperty(PropertyName = "properties.connections")] + public IList Connections { get; set; } + /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs new file mode 100644 index 000000000000..83465464334a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ExpressRouteCircuitReference + { + /// + /// Initializes a new instance of the ExpressRouteCircuitReference + /// class. + /// + public ExpressRouteCircuitReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitReference + /// class. + /// + /// Corresponding Express Route Circuit Id. + public ExpressRouteCircuitReference(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets corresponding Express Route Circuit Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs new file mode 100644 index 000000000000..fd1aa4c1d94f --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs @@ -0,0 +1,162 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ExpressRouteCrossConnection resource + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteCrossConnection : Resource + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnection + /// class. + /// + public ExpressRouteCrossConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCrossConnection + /// class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The name of the primary + /// port. + /// The name of the secondary + /// port. + /// The identifier of the circuit traffic. + /// The peering location of the + /// ExpressRoute circuit. + /// The circuit bandwidth In + /// Mbps. + /// The ExpressRouteCircuit + /// The provisioning + /// state of the circuit in the connectivity provider system. Possible + /// values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + /// Possible values include: 'NotProvisioned', 'Provisioning', + /// 'Provisioned', 'Deprovisioning' + /// Additional read only notes set + /// by the connectivity provider. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The list of peerings. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public ExpressRouteCrossConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), int? sTag = default(int?), string peeringLocation = default(string), int? bandwidthInMbps = default(int?), ExpressRouteCircuitReference expressRouteCircuit = default(ExpressRouteCircuitReference), string serviceProviderProvisioningState = default(string), string serviceProviderNotes = default(string), string provisioningState = default(string), IList peerings = default(IList), string etag = default(string)) + : base(id, name, type, location, tags) + { + PrimaryAzurePort = primaryAzurePort; + SecondaryAzurePort = secondaryAzurePort; + STag = sTag; + PeeringLocation = peeringLocation; + BandwidthInMbps = bandwidthInMbps; + ExpressRouteCircuit = expressRouteCircuit; + ServiceProviderProvisioningState = serviceProviderProvisioningState; + ServiceProviderNotes = serviceProviderNotes; + ProvisioningState = provisioningState; + Peerings = peerings; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the primary port. + /// + [JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort { get; private set; } + + /// + /// Gets the name of the secondary port. + /// + [JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort { get; private set; } + + /// + /// Gets the identifier of the circuit traffic. + /// + [JsonProperty(PropertyName = "properties.sTag")] + public int? STag { get; private set; } + + /// + /// Gets the peering location of the ExpressRoute circuit. + /// + [JsonProperty(PropertyName = "properties.peeringLocation")] + public string PeeringLocation { get; private set; } + + /// + /// Gets the circuit bandwidth In Mbps. + /// + [JsonProperty(PropertyName = "properties.bandwidthInMbps")] + public int? BandwidthInMbps { get; private set; } + + /// + /// Gets the ExpressRouteCircuit + /// + [JsonProperty(PropertyName = "properties.expressRouteCircuit")] + public ExpressRouteCircuitReference ExpressRouteCircuit { get; private set; } + + /// + /// Gets or sets the provisioning state of the circuit in the + /// connectivity provider system. Possible values are 'NotProvisioned', + /// 'Provisioning', 'Provisioned'. Possible values include: + /// 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + /// + [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] + public string ServiceProviderProvisioningState { get; set; } + + /// + /// Gets or sets additional read only notes set by the connectivity + /// provider. + /// + [JsonProperty(PropertyName = "properties.serviceProviderNotes")] + public string ServiceProviderNotes { get; set; } + + /// + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the list of peerings. + /// + [JsonProperty(PropertyName = "properties.peerings")] + public IList Peerings { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs new file mode 100644 index 000000000000..20b47edbfed6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs @@ -0,0 +1,222 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Peering in an ExpressRoute Cross Connection resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteCrossConnectionPeering : SubResource + { + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionPeering class. + /// + public ExpressRouteCrossConnectionPeering() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionPeering class. + /// + /// Resource ID. + /// The peering type. Possible values + /// include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + /// The peering state. Possible values include: + /// 'Disabled', 'Enabled' + /// The Azure ASN. + /// The peer ASN. + /// The primary address + /// prefix. + /// The secondary address + /// prefix. + /// The primary port. + /// The secondary port. + /// The shared key. + /// The VLAN ID. + /// The Microsoft peering + /// configuration. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The GatewayManager Etag. + /// Gets whether the provider or the + /// customer last modified the peering. + /// The IPv6 peering + /// configuration. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ExpressRouteCrossConnectionPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), string name = default(string), string etag = default(string)) + : base(id) + { + PeeringType = peeringType; + State = state; + AzureASN = azureASN; + PeerASN = peerASN; + PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + PrimaryAzurePort = primaryAzurePort; + SecondaryAzurePort = secondaryAzurePort; + SharedKey = sharedKey; + VlanId = vlanId; + MicrosoftPeeringConfig = microsoftPeeringConfig; + ProvisioningState = provisioningState; + GatewayManagerEtag = gatewayManagerEtag; + LastModifiedBy = lastModifiedBy; + Ipv6PeeringConfig = ipv6PeeringConfig; + Name = name; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the peering type. Possible values include: + /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// + [JsonProperty(PropertyName = "properties.peeringType")] + public string PeeringType { get; set; } + + /// + /// Gets or sets the peering state. Possible values include: + /// 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; set; } + + /// + /// Gets the Azure ASN. + /// + [JsonProperty(PropertyName = "properties.azureASN")] + public int? AzureASN { get; private set; } + + /// + /// Gets or sets the peer ASN. + /// + [JsonProperty(PropertyName = "properties.peerASN")] + public long? PeerASN { get; set; } + + /// + /// Gets or sets the primary address prefix. + /// + [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix { get; set; } + + /// + /// Gets or sets the secondary address prefix. + /// + [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix { get; set; } + + /// + /// Gets the primary port. + /// + [JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort { get; private set; } + + /// + /// Gets the secondary port. + /// + [JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort { get; private set; } + + /// + /// Gets or sets the shared key. + /// + [JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey { get; set; } + + /// + /// Gets or sets the VLAN ID. + /// + [JsonProperty(PropertyName = "properties.vlanId")] + public int? VlanId { get; set; } + + /// + /// Gets or sets the Microsoft peering configuration. + /// + [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } + + /// + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the GatewayManager Etag. + /// + [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + public string GatewayManagerEtag { get; private set; } + + /// + /// Gets whether the provider or the customer last modified the + /// peering. + /// + [JsonProperty(PropertyName = "properties.lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the IPv6 peering configuration. + /// + [JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] + public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig { get; set; } + + /// + /// Gets name of the resource that is unique within a resource group. + /// This name can be used to access the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PeerASN > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); + } + if (PeerASN < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs new file mode 100644 index 000000000000..f7ceb609a563 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The routes table associated with the ExpressRouteCircuit. + /// + public partial class ExpressRouteCrossConnectionRoutesTableSummary + { + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionRoutesTableSummary class. + /// + public ExpressRouteCrossConnectionRoutesTableSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionRoutesTableSummary class. + /// + /// IP address of Neighbor router + /// Autonomous system number. + /// The length of time that the BGP session has + /// been in the Established state, or the current status if not in the + /// Established state. + /// Current state of the BGP + /// session, and the number of prefixes that have been received from a + /// neighbor or peer group. + public ExpressRouteCrossConnectionRoutesTableSummary(string neighbor = default(string), int? asn = default(int?), string upDown = default(string), string stateOrPrefixesReceived = default(string)) + { + Neighbor = neighbor; + Asn = asn; + UpDown = upDown; + StateOrPrefixesReceived = stateOrPrefixesReceived; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets IP address of Neighbor router + /// + [JsonProperty(PropertyName = "neighbor")] + public string Neighbor { get; set; } + + /// + /// Gets or sets autonomous system number. + /// + [JsonProperty(PropertyName = "asn")] + public int? Asn { get; set; } + + /// + /// Gets or sets the length of time that the BGP session has been in + /// the Established state, or the current status if not in the + /// Established state. + /// + [JsonProperty(PropertyName = "upDown")] + public string UpDown { get; set; } + + /// + /// Gets or sets current state of the BGP session, and the number of + /// prefixes that have been received from a neighbor or peer group. + /// + [JsonProperty(PropertyName = "stateOrPrefixesReceived")] + public string StateOrPrefixesReceived { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs new file mode 100644 index 000000000000..606abbf9bc27 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Response for ListRoutesTable associated with the Express Route Cross + /// Connections. + /// + public partial class ExpressRouteCrossConnectionsRoutesTableSummaryListResult + { + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + /// + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + /// + /// A list of the routes table. + /// The URL to get the next set of + /// results. + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of the routes table. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets the URL to get the next set of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs new file mode 100644 index 000000000000..2f58bbd4e777 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for ExpressRoutePeeringState. + /// + public static class ExpressRoutePeeringState + { + public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringType.cs similarity index 85% rename from src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs rename to src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringType.cs index 253e4eab5c24..f621f7015bc9 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringType.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for ExpressRouteCircuitPeeringType. + /// Defines values for ExpressRoutePeeringType. /// - public static class ExpressRouteCircuitPeeringType + public static class ExpressRoutePeeringType { public const string AzurePublicPeering = "AzurePublicPeering"; public const string AzurePrivatePeering = "AzurePrivatePeering"; diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs b/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs index ad1faf4f61c4..12944da41ff7 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs @@ -51,9 +51,9 @@ public IpsecPolicy() /// The DH Groups used in IKE Phase 1 for initial /// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - /// The DH Groups used in IKE Phase 2 for new + /// The Pfs Groups used in IKE Phase 2 for new /// child SA. Possible values include: 'None', 'PFS1', 'PFS2', - /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24' + /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup) { SaLifeTimeSeconds = saLifeTimeSeconds; @@ -104,7 +104,8 @@ public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecE /// /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible - /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + /// 'GCMAES256', 'GCMAES128' /// [JsonProperty(PropertyName = "ikeEncryption")] public string IkeEncryption { get; set; } @@ -125,9 +126,9 @@ public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecE public string DhGroup { get; set; } /// - /// Gets or sets the DH Groups used in IKE Phase 2 for new child SA. + /// Gets or sets the Pfs Groups used in IKE Phase 2 for new child SA. /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', - /// 'ECP256', 'ECP384', 'PFS24' + /// 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' /// [JsonProperty(PropertyName = "pfsGroup")] public string PfsGroup { get; set; } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs b/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs index 1c9ae1a6267f..f57d2fc2ead6 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs @@ -23,5 +23,7 @@ public static class PfsGroup public const string ECP256 = "ECP256"; public const string ECP384 = "ECP384"; public const string PFS24 = "PFS24"; + public const string PFS14 = "PFS14"; + public const string PFSMM = "PFSMM"; } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs index 8e46f7c9d628..a7088832da19 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs @@ -54,13 +54,16 @@ public VirtualNetwork() /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// Indicates if DDoS protection is - /// enabled for all the protected resources in a Virtual - /// Network. - /// Indicates if Vm protection is - /// enabled for all the subnets in a Virtual Network. + /// enabled for all the protected resources in the virtual network. It + /// requires a DDoS protection plan associated with the + /// resource. + /// Indicates if VM protection is + /// enabled for all the subnets in the virtual network. + /// The DDoS protection plan + /// associated with the virtual network. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), string etag = default(string)) + public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), string etag = default(string)) : base(id, name, type, location, tags) { AddressSpace = addressSpace; @@ -71,6 +74,7 @@ public VirtualNetwork() ProvisioningState = provisioningState; EnableDdosProtection = enableDdosProtection; EnableVmProtection = enableVmProtection; + DdosProtectionPlan = ddosProtectionPlan; Etag = etag; CustomInit(); } @@ -122,18 +126,26 @@ public VirtualNetwork() /// /// Gets or sets indicates if DDoS protection is enabled for all the - /// protected resources in a Virtual Network. + /// protected resources in the virtual network. It requires a DDoS + /// protection plan associated with the resource. /// [JsonProperty(PropertyName = "properties.enableDdosProtection")] public bool? EnableDdosProtection { get; set; } /// - /// Gets or sets indicates if Vm protection is enabled for all the - /// subnets in a Virtual Network. + /// Gets or sets indicates if VM protection is enabled for all the + /// subnets in the virtual network. /// [JsonProperty(PropertyName = "properties.enableVmProtection")] public bool? EnableVmProtection { get; set; } + /// + /// Gets or sets the DDoS protection plan associated with the virtual + /// network. + /// + [JsonProperty(PropertyName = "properties.ddosProtectionPlan")] + public SubResource DdosProtectionPlan { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs index c5d7bcdf9937..e8a608bab321 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs @@ -41,17 +41,20 @@ public VpnClientConfiguration() /// Virtual network gateway. /// VpnClientProtocols for Virtual /// network gateway. + /// VpnClientIpsecPolicies for + /// virtual network gateway P2S client. /// The radius server address /// property of the VirtualNetworkGateway resource for vpn client /// connection. /// The radius secret property of the /// VirtualNetworkGateway resource for vpn client connection. - public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList vpnClientProtocols = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string)) + public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList vpnClientProtocols = default(IList), IList vpnClientIpsecPolicies = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string)) { VpnClientAddressPool = vpnClientAddressPool; VpnClientRootCertificates = vpnClientRootCertificates; VpnClientRevokedCertificates = vpnClientRevokedCertificates; VpnClientProtocols = vpnClientProtocols; + VpnClientIpsecPolicies = vpnClientIpsecPolicies; RadiusServerAddress = radiusServerAddress; RadiusServerSecret = radiusServerSecret; CustomInit(); @@ -88,6 +91,13 @@ public VpnClientConfiguration() [JsonProperty(PropertyName = "vpnClientProtocols")] public IList VpnClientProtocols { get; set; } + /// + /// Gets or sets vpnClientIpsecPolicies for virtual network gateway P2S + /// client. + /// + [JsonProperty(PropertyName = "vpnClientIpsecPolicies")] + public IList VpnClientIpsecPolicies { get; set; } + /// /// Gets or sets the radius server address property of the /// VirtualNetworkGateway resource for vpn client connection. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs new file mode 100644 index 000000000000..e77483a7a45d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs @@ -0,0 +1,169 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An IPSec parameters for a virtual network gateway P2S connection. + /// + public partial class VpnClientIPsecParameters + { + /// + /// Initializes a new instance of the VpnClientIPsecParameters class. + /// + public VpnClientIPsecParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnClientIPsecParameters class. + /// + /// The IPSec Security Association + /// (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S + /// client. + /// The IPSec Security Association + /// (also called Quick Mode or Phase 2 SA) payload size in KB for P2S + /// client.. + /// The IPSec encryption algorithm (IKE + /// phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + /// 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// The IPSec integrity algorithm (IKE + /// phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + /// 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// The IKE encryption algorithm (IKE phase + /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', + /// 'AES256' + /// The IKE integrity algorithm (IKE phase + /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', + /// 'SHA384' + /// The DH Groups used in IKE Phase 1 for initial + /// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + /// The Pfs Groups used in IKE Phase 2 for new + /// child SA. Possible values include: 'None', 'PFS1', 'PFS2', + /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + public VpnClientIPsecParameters(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup) + { + SaLifeTimeSeconds = saLifeTimeSeconds; + SaDataSizeKilobytes = saDataSizeKilobytes; + IpsecEncryption = ipsecEncryption; + IpsecIntegrity = ipsecIntegrity; + IkeEncryption = ikeEncryption; + IkeIntegrity = ikeIntegrity; + DhGroup = dhGroup; + PfsGroup = pfsGroup; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the IPSec Security Association (also called Quick Mode + /// or Phase 2 SA) lifetime in seconds for P2S client. + /// + [JsonProperty(PropertyName = "saLifeTimeSeconds")] + public int SaLifeTimeSeconds { get; set; } + + /// + /// Gets or sets the IPSec Security Association (also called Quick Mode + /// or Phase 2 SA) payload size in KB for P2S client.. + /// + [JsonProperty(PropertyName = "saDataSizeKilobytes")] + public int SaDataSizeKilobytes { get; set; } + + /// + /// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible + /// values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + /// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// + [JsonProperty(PropertyName = "ipsecEncryption")] + public string IpsecEncryption { get; set; } + + /// + /// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible + /// values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', + /// 'GCMAES256' + /// + [JsonProperty(PropertyName = "ipsecIntegrity")] + public string IpsecIntegrity { get; set; } + + /// + /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible + /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + /// + [JsonProperty(PropertyName = "ikeEncryption")] + public string IkeEncryption { get; set; } + + /// + /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible + /// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + /// + [JsonProperty(PropertyName = "ikeIntegrity")] + public string IkeIntegrity { get; set; } + + /// + /// Gets or sets the DH Groups used in IKE Phase 1 for initial SA. + /// Possible values include: 'None', 'DHGroup1', 'DHGroup2', + /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + /// + [JsonProperty(PropertyName = "dhGroup")] + public string DhGroup { get; set; } + + /// + /// Gets or sets the Pfs Groups used in IKE Phase 2 for new child SA. + /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + /// 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + /// + [JsonProperty(PropertyName = "pfsGroup")] + public string PfsGroup { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IpsecEncryption == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpsecEncryption"); + } + if (IpsecIntegrity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpsecIntegrity"); + } + if (IkeEncryption == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IkeEncryption"); + } + if (IkeIntegrity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IkeIntegrity"); + } + if (DhGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DhGroup"); + } + if (PfsGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PfsGroup"); + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs index 97f9388a2f76..6222f1ff1aad 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -90,11 +90,14 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -291,11 +293,14 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,7 +311,6 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("ipConfigurationName", ipConfigurationName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -318,9 +322,9 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs index 5e1c26fe5164..051592a745fc 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -90,11 +90,14 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -104,7 +107,6 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -115,9 +117,9 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs index 096ddf0be755..88ea4de3eda1 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs @@ -115,11 +115,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -350,11 +352,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -371,9 +375,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -533,11 +537,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +553,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -556,9 +562,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -781,7 +787,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -977,7 +983,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1188,7 +1194,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1409,7 +1415,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1637,7 +1643,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1835,11 +1841,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1849,7 +1858,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1860,9 +1868,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2018,11 +2026,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2033,7 +2044,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -2044,9 +2054,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2244,11 +2254,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2259,7 +2272,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -2270,9 +2282,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2445,11 +2457,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2459,7 +2474,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); } @@ -2470,9 +2484,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2639,11 +2653,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2653,7 +2670,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); } @@ -2664,9 +2680,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs index 6204b02053a1..7e5d0aa4fa9e 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs @@ -55,6 +55,11 @@ public partial class NetworkManagementClient : ServiceClient public string SubscriptionId { get; set; } + /// + /// Client API version. + /// + public string ApiVersion { get; private set; } + /// /// Gets or sets the preferred language for the response. /// @@ -82,6 +87,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IApplicationSecurityGroupsOperations ApplicationSecurityGroups { get; private set; } + /// + /// Gets the IDdosProtectionPlansOperations. + /// + public virtual IDdosProtectionPlansOperations DdosProtectionPlans { get; private set; } + /// /// Gets the IAvailableEndpointServicesOperations. /// @@ -97,6 +107,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IExpressRouteCircuitPeeringsOperations ExpressRouteCircuitPeerings { get; private set; } + /// + /// Gets the IExpressRouteCircuitConnectionsOperations. + /// + public virtual IExpressRouteCircuitConnectionsOperations ExpressRouteCircuitConnections { get; private set; } + /// /// Gets the IExpressRouteCircuitsOperations. /// @@ -107,6 +122,16 @@ public partial class NetworkManagementClient : ServiceClient public virtual IExpressRouteServiceProvidersOperations ExpressRouteServiceProviders { get; private set; } + /// + /// Gets the IExpressRouteCrossConnectionsOperations. + /// + public virtual IExpressRouteCrossConnectionsOperations ExpressRouteCrossConnections { get; private set; } + + /// + /// Gets the IExpressRouteCrossConnectionPeeringsOperations. + /// + public virtual IExpressRouteCrossConnectionPeeringsOperations ExpressRouteCrossConnectionPeerings { get; private set; } + /// /// Gets the ILoadBalancersOperations. /// @@ -460,11 +485,15 @@ private void Initialize() { ApplicationGateways = new ApplicationGatewaysOperations(this); ApplicationSecurityGroups = new ApplicationSecurityGroupsOperations(this); + DdosProtectionPlans = new DdosProtectionPlansOperations(this); AvailableEndpointServices = new AvailableEndpointServicesOperations(this); ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); + ExpressRouteCircuitConnections = new ExpressRouteCircuitConnectionsOperations(this); ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); + ExpressRouteCrossConnections = new ExpressRouteCrossConnectionsOperations(this); + ExpressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsOperations(this); LoadBalancers = new LoadBalancersOperations(this); LoadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsOperations(this); LoadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsOperations(this); @@ -496,6 +525,7 @@ private void Initialize() VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2018-02-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -571,11 +601,14 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "domainNameLabel"); } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } if (SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -585,7 +618,6 @@ private void Initialize() Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("domainNameLabel", domainNameLabel); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); } @@ -599,9 +631,9 @@ private void Initialize() { _queryParameters.Add(string.Format("domainNameLabel={0}", System.Uri.EscapeDataString(domainNameLabel))); } - if (apiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs index 65734359fa8f..efb0f0221c78 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs @@ -115,11 +115,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -352,11 +354,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -364,7 +369,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -373,9 +377,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -535,11 +539,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +555,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -558,9 +564,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -724,11 +730,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,7 +747,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -749,9 +757,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -909,11 +917,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -924,7 +935,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -935,9 +945,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1135,11 +1145,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1150,7 +1163,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1161,9 +1173,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs index ce114ba7f0c2..e5c4618dcf69 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs @@ -97,11 +97,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +115,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -123,9 +125,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -316,11 +318,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -330,7 +335,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -341,9 +345,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -539,11 +543,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -554,7 +561,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } @@ -565,9 +571,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -733,11 +739,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +755,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -756,9 +764,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -911,11 +919,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -923,7 +934,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -932,9 +942,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1108,11 +1118,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1123,7 +1136,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetTopology", tracingParameters); } @@ -1134,9 +1146,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1561,11 +1573,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1575,7 +1590,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1586,9 +1600,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1749,11 +1763,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1764,7 +1781,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginVerifyIPFlow", tracingParameters); } @@ -1775,9 +1791,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1979,11 +1995,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1994,7 +2013,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetNextHop", tracingParameters); } @@ -2005,9 +2023,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2209,11 +2227,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2224,7 +2245,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetVMSecurityRules", tracingParameters); } @@ -2235,9 +2255,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2439,11 +2459,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2454,7 +2477,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetTroubleshooting", tracingParameters); } @@ -2465,9 +2487,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2669,11 +2691,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2684,7 +2709,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetTroubleshootingResult", tracingParameters); } @@ -2695,9 +2719,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2899,11 +2923,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2914,7 +2941,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginSetFlowLogConfiguration", tracingParameters); } @@ -2925,9 +2951,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3129,11 +3155,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3144,7 +3173,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetFlowLogStatus", tracingParameters); } @@ -3155,9 +3183,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3361,11 +3389,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3376,7 +3407,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCheckConnectivity", tracingParameters); } @@ -3387,9 +3417,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3592,11 +3622,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3607,7 +3640,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetAzureReachabilityReport", tracingParameters); } @@ -3618,9 +3650,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3819,11 +3851,14 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3834,7 +3869,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListAvailableProviders", tracingParameters); } @@ -3845,9 +3879,9 @@ internal NetworkWatchersOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/Operations.cs b/src/SDKs/Network/Management.Network/Generated/Operations.cs index 90e49fc3f7f4..4abf237eff1c 100644 --- a/src/SDKs/Network/Management.Network/Generated/Operations.cs +++ b/src/SDKs/Network/Management.Network/Generated/Operations.cs @@ -65,12 +65,21 @@ internal Operations(NetworkManagementClient client) /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2018-01-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -78,7 +87,6 @@ internal Operations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -86,9 +94,9 @@ internal Operations(NetworkManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Network/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs index 57341674bdf1..728afdcb885a 100644 --- a/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs @@ -125,11 +125,14 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -140,7 +143,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -152,9 +154,9 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -396,11 +398,14 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -410,7 +415,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -421,9 +425,9 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -608,11 +612,14 @@ internal PacketCapturesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -624,7 +631,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } @@ -636,9 +642,9 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -815,11 +821,14 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -830,7 +839,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -842,9 +850,9 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -997,11 +1005,14 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1012,7 +1023,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } @@ -1024,9 +1034,9 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1182,11 +1192,14 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "packetCaptureName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1197,7 +1210,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkWatcherName", networkWatcherName); tracingParameters.Add("packetCaptureName", packetCaptureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetStatus", tracingParameters); } @@ -1209,9 +1221,9 @@ internal PacketCapturesOperations(NetworkManagementClient client) _url = _url.Replace("{packetCaptureName}", System.Uri.EscapeDataString(packetCaptureName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs index 73c99fcd8f66..9229ad2cd660 100644 --- a/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs @@ -115,11 +115,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -350,11 +352,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -371,9 +375,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -533,11 +537,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +553,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -556,9 +562,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -730,7 +736,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -946,7 +952,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1177,7 +1183,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-03-30"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1377,11 +1383,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1391,7 +1400,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1402,9 +1410,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1560,11 +1568,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1575,7 +1586,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1586,9 +1596,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1786,11 +1796,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1801,7 +1814,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1812,9 +1824,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs index 95669be706ca..b3304bcc118d 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs @@ -122,11 +122,14 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -137,7 +140,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -149,9 +151,9 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -374,11 +376,14 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -388,7 +393,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByRouteFilter", tracingParameters); } @@ -399,9 +403,9 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -572,11 +576,14 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -587,7 +594,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -599,9 +605,9 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -768,11 +774,14 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { routeFilterRuleParameters.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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -784,7 +793,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("routeFilterRuleParameters", routeFilterRuleParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -796,9 +804,9 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1003,11 +1011,14 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterRuleParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1019,7 +1030,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("routeFilterRuleParameters", routeFilterRuleParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } @@ -1031,9 +1041,9 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs index 387bfcf14630..2d70dcd34556 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs @@ -115,11 +115,14 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -357,11 +359,14 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +375,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -380,9 +384,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -535,11 +539,14 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -547,7 +554,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -556,9 +562,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -722,11 +728,14 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,7 +745,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -747,9 +755,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -905,11 +913,14 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +931,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("routeFilterParameters", routeFilterParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -931,9 +941,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1131,11 +1141,14 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1146,7 +1159,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("routeFilterParameters", routeFilterParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } @@ -1157,9 +1169,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs index 6325c73de766..59c7d178b0a6 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs @@ -115,11 +115,14 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal RouteTablesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -357,11 +359,14 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +375,6 @@ internal RouteTablesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -380,9 +384,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -535,11 +539,14 @@ internal RouteTablesOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -547,7 +554,6 @@ internal RouteTablesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -556,9 +562,9 @@ internal RouteTablesOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -722,11 +728,14 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,7 +745,6 @@ internal RouteTablesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -747,9 +755,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -905,11 +913,14 @@ internal RouteTablesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +931,6 @@ internal RouteTablesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -931,9 +941,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1131,11 +1141,14 @@ internal RouteTablesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1146,7 +1159,6 @@ internal RouteTablesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1157,9 +1169,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs index e21b0dc96fde..665a3bfaa8c9 100644 --- a/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs @@ -122,11 +122,14 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -137,7 +140,6 @@ internal RoutesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -149,9 +151,9 @@ internal RoutesOperations(NetworkManagementClient client) _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -346,11 +348,14 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -360,7 +365,6 @@ internal RoutesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -371,9 +375,9 @@ internal RoutesOperations(NetworkManagementClient client) _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -544,11 +548,14 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -559,7 +566,6 @@ internal RoutesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -571,9 +577,9 @@ internal RoutesOperations(NetworkManagementClient client) _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -740,11 +746,14 @@ internal RoutesOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -756,7 +765,6 @@ internal RoutesOperations(NetworkManagementClient client) tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("routeParameters", routeParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -768,9 +776,9 @@ internal RoutesOperations(NetworkManagementClient client) _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs index 447b34cd53e6..b848884a10c2 100644 --- a/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs @@ -11,46 +11,50 @@ public static IEnumerable> ApiInfo_NetworkManageme { return new Tuple[] { - new Tuple("Compute", "NetworkInterfaces", "2017-03-30"), - new Tuple("Compute", "PublicIPAddresses", "2017-03-30"), - new Tuple("Network", "ApplicationGateways", "2018-01-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2018-01-01"), - new Tuple("Network", "AvailableEndpointServices", "2018-01-01"), - new Tuple("Network", "BgpServiceCommunities", "2018-01-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2018-01-01"), - new Tuple("Network", "ConnectionMonitors", "2018-01-01"), - new Tuple("Network", "DefaultSecurityRules", "2018-01-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2018-01-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2018-01-01"), - new Tuple("Network", "ExpressRouteCircuits", "2018-01-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2018-01-01"), - new Tuple("Network", "InboundNatRules", "2018-01-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2018-01-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2018-01-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2018-01-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2018-01-01"), - new Tuple("Network", "LoadBalancerProbes", "2018-01-01"), - new Tuple("Network", "LoadBalancers", "2018-01-01"), - new Tuple("Network", "LocalNetworkGateways", "2018-01-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2018-01-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2018-01-01"), - new Tuple("Network", "NetworkInterfaces", "2018-01-01"), - new Tuple("Network", "NetworkSecurityGroups", "2018-01-01"), - new Tuple("Network", "NetworkWatchers", "2018-01-01"), - new Tuple("Network", "Operations", "2018-01-01"), - new Tuple("Network", "PacketCaptures", "2018-01-01"), - new Tuple("Network", "PublicIPAddresses", "2018-01-01"), - new Tuple("Network", "RouteFilterRules", "2018-01-01"), - new Tuple("Network", "RouteFilters", "2018-01-01"), - new Tuple("Network", "RouteTables", "2018-01-01"), - new Tuple("Network", "Routes", "2018-01-01"), - new Tuple("Network", "SecurityRules", "2018-01-01"), - new Tuple("Network", "Subnets", "2018-01-01"), - new Tuple("Network", "Usages", "2018-01-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2018-01-01"), - new Tuple("Network", "VirtualNetworkGateways", "2018-01-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2018-01-01"), - new Tuple("Network", "VirtualNetworks", "2018-01-01"), + new Tuple("Compute", "NetworkInterfaces", "2018-02-01"), + new Tuple("Compute", "PublicIPAddresses", "2018-02-01"), + new Tuple("Network", "ApplicationGateways", "2018-02-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2018-02-01"), + new Tuple("Network", "AvailableEndpointServices", "2018-02-01"), + new Tuple("Network", "BgpServiceCommunities", "2018-02-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2018-02-01"), + new Tuple("Network", "ConnectionMonitors", "2018-02-01"), + new Tuple("Network", "DdosProtectionPlans", "2018-02-01"), + new Tuple("Network", "DefaultSecurityRules", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuits", "2018-02-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2018-02-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2018-02-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2018-02-01"), + new Tuple("Network", "InboundNatRules", "2018-02-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2018-02-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2018-02-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2018-02-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2018-02-01"), + new Tuple("Network", "LoadBalancerProbes", "2018-02-01"), + new Tuple("Network", "LoadBalancers", "2018-02-01"), + new Tuple("Network", "LocalNetworkGateways", "2018-02-01"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2018-02-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2018-02-01"), + new Tuple("Network", "NetworkInterfaces", "2018-02-01"), + new Tuple("Network", "NetworkSecurityGroups", "2018-02-01"), + new Tuple("Network", "NetworkWatchers", "2018-02-01"), + new Tuple("Network", "Operations", "2018-02-01"), + new Tuple("Network", "PacketCaptures", "2018-02-01"), + new Tuple("Network", "PublicIPAddresses", "2018-02-01"), + new Tuple("Network", "RouteFilterRules", "2018-02-01"), + new Tuple("Network", "RouteFilters", "2018-02-01"), + new Tuple("Network", "RouteTables", "2018-02-01"), + new Tuple("Network", "Routes", "2018-02-01"), + new Tuple("Network", "SecurityRules", "2018-02-01"), + new Tuple("Network", "Subnets", "2018-02-01"), + new Tuple("Network", "Usages", "2018-02-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2018-02-01"), + new Tuple("Network", "VirtualNetworkGateways", "2018-02-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2018-02-01"), + new Tuple("Network", "VirtualNetworks", "2018-02-01"), }.AsEnumerable(); } } diff --git a/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs index a6a00f7a4814..e60b22e1e579 100644 --- a/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs @@ -122,11 +122,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -137,7 +140,6 @@ internal SecurityRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -149,9 +151,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -347,11 +349,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +366,6 @@ internal SecurityRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -372,9 +376,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -545,11 +549,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +567,6 @@ internal SecurityRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -572,9 +578,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -742,11 +748,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) { securityRuleParameters.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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -758,7 +767,6 @@ internal SecurityRulesOperations(NetworkManagementClient client) tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("securityRuleParameters", securityRuleParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -770,9 +778,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs b/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs index 4f7ad531c368..4e5335729c55 100644 --- a/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs @@ -125,11 +125,14 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -140,7 +143,6 @@ internal SubnetsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -153,9 +155,9 @@ internal SubnetsOperations(NetworkManagementClient client) _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -354,11 +356,14 @@ internal SubnetsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -368,7 +373,6 @@ internal SubnetsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -379,9 +383,9 @@ internal SubnetsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -552,11 +556,14 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -567,7 +574,6 @@ internal SubnetsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -579,9 +585,9 @@ internal SubnetsOperations(NetworkManagementClient client) _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -744,11 +750,14 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "subnetParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -760,7 +769,6 @@ internal SubnetsOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); tracingParameters.Add("subnetParameters", subnetParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -772,9 +780,9 @@ internal SubnetsOperations(NetworkManagementClient client) _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs b/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs index 848b7576bd9a..0ae7d496f510 100644 --- a/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs @@ -90,11 +90,14 @@ internal UsagesOperations(NetworkManagementClient client) throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +106,6 @@ internal UsagesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -113,9 +115,9 @@ internal UsagesOperations(NetworkManagementClient client) _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs index 6d6ce6b16e46..33147445484b 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -117,11 +117,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -131,7 +134,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -142,9 +144,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -389,11 +391,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -403,7 +408,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); } @@ -414,9 +418,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -577,11 +581,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -590,7 +597,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -600,9 +606,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -811,11 +817,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -826,7 +835,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -837,9 +845,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1027,11 +1035,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1041,7 +1052,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1052,9 +1062,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1210,11 +1220,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1225,7 +1238,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1236,9 +1248,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1426,11 +1438,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1441,7 +1456,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); } @@ -1452,9 +1466,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1660,11 +1674,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1675,7 +1692,6 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); } @@ -1686,9 +1702,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index 062390cb277d..8d33cd25aa6a 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -116,11 +116,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +133,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -141,9 +143,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -350,11 +352,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +368,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -373,9 +377,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -542,11 +546,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +563,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListConnections", tracingParameters); } @@ -567,9 +573,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -866,11 +872,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -880,7 +889,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "SupportedVpnDevices", tracingParameters); } @@ -891,9 +899,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1069,6 +1077,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Gets a xml format representation for vpn device configuration script. /// @@ -1117,11 +1177,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1132,7 +1195,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "VpnDeviceConfigurationScript", tracingParameters); } @@ -1143,9 +1205,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1326,11 +1388,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1341,7 +1406,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1352,9 +1416,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1542,11 +1606,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1556,7 +1623,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1567,9 +1633,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1725,11 +1791,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1740,7 +1809,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1751,9 +1819,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1931,11 +1999,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1946,7 +2017,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("gatewayVip", gatewayVip); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } @@ -1961,9 +2031,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _queryParameters.Add(string.Format("gatewayVip={0}", System.Uri.EscapeDataString(gatewayVip))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2139,11 +2209,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2154,7 +2227,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGeneratevpnclientpackage", tracingParameters); } @@ -2165,9 +2237,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2349,11 +2421,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2364,7 +2439,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateVpnProfile", tracingParameters); } @@ -2375,9 +2449,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2552,11 +2626,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2566,7 +2643,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnProfilePackageUrl", tracingParameters); } @@ -2577,9 +2653,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2749,11 +2825,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2764,7 +2843,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("peer", peer); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetBgpPeerStatus", tracingParameters); } @@ -2779,9 +2857,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _queryParameters.Add(string.Format("peer={0}", System.Uri.EscapeDataString(peer))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2949,11 +3027,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2963,7 +3044,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetLearnedRoutes", tracingParameters); } @@ -2974,9 +3054,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3151,11 +3231,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peer"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3166,7 +3249,6 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("peer", peer); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginGetAdvertisedRoutes", tracingParameters); } @@ -3181,9 +3263,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { _queryParameters.Add(string.Format("peer={0}", System.Uri.EscapeDataString(peer))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3310,6 +3392,421 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) return _result; } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + } + if (vpnclientIpsecParams == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnclientIpsecParams"); + } + if (vpnclientIpsecParams != null) + { + vpnclientIpsecParams.Validate(); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("vpnclientIpsecParams", vpnclientIpsecParams); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSetVpnclientIpsecParameters", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(vpnclientIpsecParams != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnclientIpsecParams, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + } + if (Client.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 = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnclientIpsecParameters", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _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 + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Gets all virtual network gateways by resource group. /// diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 133ac189a623..04326f7b444e 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -636,6 +636,102 @@ public static GatewayRouteListResult GetAdvertisedRoutes(this IVirtualNetworkGat } } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + public static VpnClientIPsecParameters SetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) + { + return operations.SetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); + } + + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// The cancellation token. + /// + public static async Task SetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + public static VpnClientIPsecParameters GetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return operations.GetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The cancellation token. + /// + public static async Task GetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a xml format representation for vpn device configuration script. /// @@ -1145,6 +1241,102 @@ public static GatewayRouteListResult BeginGetAdvertisedRoutes(this IVirtualNetwo } } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + public static VpnClientIPsecParameters BeginSetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) + { + return operations.BeginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); + } + + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// The cancellation token. + /// + public static async Task BeginSetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + public static VpnClientIPsecParameters BeginGetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return operations.BeginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all virtual network gateways by resource group. /// diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs index 8285a814144f..be280d738ea0 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs @@ -122,11 +122,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -137,7 +140,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -149,9 +151,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -347,11 +349,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +366,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -372,9 +376,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -545,11 +549,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +567,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -572,9 +578,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -738,11 +744,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -754,7 +763,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -766,9 +774,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs index ead7a93f6542..1e4561937721 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs @@ -115,11 +115,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -141,9 +143,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { @@ -350,11 +352,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } @@ -371,9 +375,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) 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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -533,11 +537,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +553,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -556,9 +562,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -728,11 +734,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -743,7 +752,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) tracingParameters.Add("ipAddress", ipAddress); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); } @@ -758,9 +766,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -927,11 +935,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -941,7 +952,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListUsage", tracingParameters); } @@ -952,9 +962,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1118,11 +1128,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1132,7 +1145,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1143,9 +1155,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1301,11 +1313,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1316,7 +1331,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1327,9 +1341,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1527,11 +1541,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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"); } - string apiVersion = "2018-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1542,7 +1559,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } @@ -1553,9 +1569,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj b/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj index 1e8ddfd42d00..6b4172e4d0c6 100644 --- a/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj +++ b/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj @@ -7,18 +7,16 @@ Microsoft.Azure.Management.Network Provides management capabilities for Network services. Microsoft.Azure.Management.Network - 17.0.0-preview + 17.1.0-preview Microsoft Azure Network management;Network;Network management; - - + * Added new APIs:SetVpnclientIpsecParameters and GetVpnclientIpsecParameters to set and read the custom Ipsec policy for P2S clients resp. Updated VpnClientConfiguration with new optional property:VpnClientIpsecPolicies to be able to set ipsec policy for P2S vpnclients during create/update virtual network gateway. net452;netstandard1.4 - + + false + diff --git a/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs b/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs index dfe47c1e5a86..4e3768eca29c 100644 --- a/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs +++ b/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides Microsoft Azure Network management functions for managing the Microsoft Azure Network service.")] [assembly: AssemblyVersion("17.0.0.0")] -[assembly: AssemblyFileVersion("17.0.0.0")] +[assembly: AssemblyFileVersion("17.1.0.0")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/src/SDKs/Network/Network.Tests/Network.Tests.csproj b/src/SDKs/Network/Network.Tests/Network.Tests.csproj index 26291899a0d8..c93fe62cd199 100644 --- a/src/SDKs/Network/Network.Tests/Network.Tests.csproj +++ b/src/SDKs/Network/Network.Tests/Network.Tests.csproj @@ -9,6 +9,9 @@ netcoreapp1.1 + + false + diff --git a/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs b/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs index ec45fb55a4ee..f0990fb2202b 100644 --- a/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs +++ b/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs @@ -54,8 +54,8 @@ public static ExpressRouteCircuit UpdateDefaultExpressRouteCircuitWithMicrosoftP { var peering = new ExpressRouteCircuitPeering() { - Name = ExpressRouteCircuitPeeringType.MicrosoftPeering.ToString(), - PeeringType = ExpressRouteCircuitPeeringType.MicrosoftPeering, + Name = ExpressRoutePeeringType.MicrosoftPeering.ToString(), + PeeringType = ExpressRoutePeeringType.MicrosoftPeering, PeerASN = Convert.ToInt32(ExpressRouteTests.MS_PeerASN), VlanId = Convert.ToInt32(ExpressRouteTests.MS_VlanId), PrimaryPeerAddressPrefix = ExpressRouteTests.MS_PrimaryPrefix, @@ -97,8 +97,8 @@ public static ExpressRouteCircuit UpdateDefaultExpressRouteCircuitWithIpv6Micros var peering = new ExpressRouteCircuitPeering() { - Name = ExpressRouteCircuitPeeringType.MicrosoftPeering.ToString(), - PeeringType = ExpressRouteCircuitPeeringType.MicrosoftPeering, + Name = ExpressRoutePeeringType.MicrosoftPeering.ToString(), + PeeringType = ExpressRoutePeeringType.MicrosoftPeering, PeerASN = Convert.ToInt32(ExpressRouteTests.MS_PeerASN), VlanId = Convert.ToInt32(ExpressRouteTests.MS_VlanId), Ipv6PeeringConfig = ipv6Peering @@ -118,8 +118,8 @@ public static ExpressRouteCircuit UpdateDefaultExpressRouteCircuitWithMicrosoftP var peering = new ExpressRouteCircuitPeering() { - Name = ExpressRouteCircuitPeeringType.MicrosoftPeering.ToString(), - PeeringType = ExpressRouteCircuitPeeringType.MicrosoftPeering, + Name = ExpressRoutePeeringType.MicrosoftPeering.ToString(), + PeeringType = ExpressRoutePeeringType.MicrosoftPeering, PeerASN = Convert.ToInt32(ExpressRouteTests.MS_PeerASN), PrimaryPeerAddressPrefix = ExpressRouteTests.MS_PrimaryPrefix, SecondaryPeerAddressPrefix = ExpressRouteTests.MS_SecondaryPrefix, diff --git a/src/SDKs/_metadata/network_resource-manager.txt b/src/SDKs/_metadata/network_resource-manager.txt index 3f5cbe29faac..374738851ce3 100644 --- a/src/SDKs/_metadata/network_resource-manager.txt +++ b/src/SDKs/_metadata/network_resource-manager.txt @@ -1,11 +1,11 @@ -2018-02-01 07:45:40 UTC +2018-03-28 01:20:38 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: master -Commit: ac3f87ab0554ddf7fbc418d29bc02fbc30d384f3 +Commit: c31daf20a26d4ec8e247f4261b61fb77334d260d 2) AutoRest information Requested version: latest -Bootstrapper version: D:\nvm\v7.10.0 `-- autorest@2.0.4245 +Bootstrapper version: C:\Users\nilamd\AppData\Roaming\npm `-- autorest@2.0.4245 Latest installed version: From c0d888c049e06e2ba5754d1cc5e3febebe1fbb7a Mon Sep 17 00:00:00 2001 From: Nilambari Date: Thu, 29 Mar 2018 18:34:30 -0700 Subject: [PATCH 2/2] #1443089: Generate sdk-for-net artifacts from Networking Swagger Network-2018-02-01 branch --- .../Management.Network/Generated/Models/IkeEncryption.cs | 2 ++ .../Management.Network/Generated/Models/IpsecPolicy.cs | 2 +- .../Generated/Models/VpnClientIPsecParameters.cs | 5 +++-- src/SDKs/_metadata/network_resource-manager.txt | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs b/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs index c1556b38a424..0ba8cd89d0ec 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs @@ -21,5 +21,7 @@ public static class IkeEncryption public const string AES128 = "AES128"; public const string AES192 = "AES192"; public const string AES256 = "AES256"; + public const string GCMAES256 = "GCMAES256"; + public const string GCMAES128 = "GCMAES128"; } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs b/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs index 12944da41ff7..013d01481de8 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs @@ -44,7 +44,7 @@ public IpsecPolicy() /// 'GCMAES128', 'GCMAES192', 'GCMAES256' /// The IKE encryption algorithm (IKE phase /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256' + /// 'AES256', 'GCMAES256', 'GCMAES128' /// The IKE integrity algorithm (IKE phase /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', /// 'SHA384' diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs index e77483a7a45d..e83af4295480 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs @@ -44,7 +44,7 @@ public VpnClientIPsecParameters() /// 'GCMAES128', 'GCMAES192', 'GCMAES256' /// The IKE encryption algorithm (IKE phase /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256' + /// 'AES256', 'GCMAES256', 'GCMAES128' /// The IKE integrity algorithm (IKE phase /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', /// 'SHA384' @@ -104,7 +104,8 @@ public VpnClientIPsecParameters(int saLifeTimeSeconds, int saDataSizeKilobytes, /// /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible - /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + /// 'GCMAES256', 'GCMAES128' /// [JsonProperty(PropertyName = "ikeEncryption")] public string IkeEncryption { get; set; } diff --git a/src/SDKs/_metadata/network_resource-manager.txt b/src/SDKs/_metadata/network_resource-manager.txt index 374738851ce3..7b7ba388bca8 100644 --- a/src/SDKs/_metadata/network_resource-manager.txt +++ b/src/SDKs/_metadata/network_resource-manager.txt @@ -1,9 +1,9 @@ -2018-03-28 01:20:38 UTC +2018-03-30 01:27:35 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: master -Commit: c31daf20a26d4ec8e247f4261b61fb77334d260d +Commit: 47d267f7ece8c9c711543be3638692f5f0f8eb3f 2) AutoRest information Requested version: latest