diff --git a/src/SDKs/Network/AzSdk.RP.props b/src/SDKs/Network/AzSdk.RP.props index a4db7e7f3c2d6..38d883af78643 100644 --- a/src/SDKs/Network/AzSdk.RP.props +++ b/src/SDKs/Network/AzSdk.RP.props @@ -1,7 +1,7 @@ - Compute_2017-03-30;Network_2018-06-01; + Compute_2017-03-30;Network_2018-07-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs index 9a41c5df7abae..d5e542bfc847b 100644 --- a/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs @@ -116,7 +116,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -778,7 +778,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -954,7 +954,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1130,7 +1130,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1313,7 +1313,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1502,7 +1502,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1689,7 +1689,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1915,7 +1915,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2113,7 +2113,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2286,7 +2286,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2467,7 +2467,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs index 99e096d6c5d84..894da3c70296e 100644 --- a/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs @@ -116,7 +116,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -322,7 +322,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -694,7 +694,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -878,7 +878,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs index 3d2dba66162c4..c74088a325d40 100644 --- a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs @@ -87,7 +87,7 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/AzureFirewallsOperations.cs b/src/SDKs/Network/Management.Network/Generated/AzureFirewallsOperations.cs index e7b83c5aec7d0..9bb5501953679 100644 --- a/src/SDKs/Network/Management.Network/Generated/AzureFirewallsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/AzureFirewallsOperations.cs @@ -116,7 +116,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -328,7 +328,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -506,7 +506,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,7 +693,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -876,7 +876,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs b/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs index c2d97a99e587c..797e98381a769 100644 --- a/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs @@ -80,7 +80,7 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs index 11925ead9c1a3..b02bd9bd5e3a3 100644 --- a/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs @@ -96,7 +96,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -216,14 +216,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -233,10 +232,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); @@ -396,7 +391,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -425,7 +420,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -510,14 +505,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -527,10 +521,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); @@ -596,7 +586,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -637,7 +627,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -731,14 +721,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -748,10 +737,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); @@ -832,7 +817,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -862,7 +847,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -949,14 +934,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -966,10 +950,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); @@ -1014,7 +994,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1044,7 +1024,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1131,14 +1111,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1148,10 +1127,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); @@ -1196,7 +1171,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1226,7 +1201,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1313,14 +1288,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1330,10 +1304,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); @@ -1378,7 +1348,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1411,7 +1381,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1498,14 +1468,13 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1515,10 +1484,6 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) } 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); diff --git a/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs index 0943b93fd5890..b44bf77650c39 100644 --- a/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs @@ -116,7 +116,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,7 +693,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -876,7 +876,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs index 973d6fa2e3478..bd47471149fea 100644 --- a/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs @@ -94,7 +94,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index 15689f098c3cc..9f4e1dfde6f6d 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -127,7 +127,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs index 29aae11a49947..04613a98c60aa 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -138,7 +138,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -381,7 +381,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -584,7 +584,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs index 204fced93f4d0..7ea6a9284aee3 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -126,7 +126,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs index 886566b4360e7..17550567d235f 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -448,7 +448,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -649,7 +649,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -838,7 +838,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1016,7 +1016,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1203,7 +1203,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1387,7 +1387,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1613,7 +1613,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1829,7 +1829,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2042,7 +2042,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2255,7 +2255,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs index 733905011209c..3940504d7de3c 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -94,7 +94,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +320,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs index 0f62948ea95ea..9eeb4c8cc3b5c 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -455,7 +455,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -793,7 +793,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1001,7 +1001,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1217,7 +1217,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1430,7 +1430,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1643,7 +1643,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs index 3d30b3353e8f0..3a638740c4d8a 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/HubVirtualNetworkConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/HubVirtualNetworkConnectionsOperations.cs index cfb39b3bfc154..80426630fa8bb 100644 --- a/src/SDKs/Network/Management.Network/Generated/HubVirtualNetworkConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/HubVirtualNetworkConnectionsOperations.cs @@ -101,7 +101,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -292,7 +292,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/IConnectionMonitorsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IConnectionMonitorsOperations.cs index 1571f9a2c632c..5f3338ead98ef 100644 --- a/src/SDKs/Network/Management.Network/Generated/IConnectionMonitorsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/IConnectionMonitorsOperations.cs @@ -45,7 +45,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -73,7 +73,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -126,7 +126,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -151,7 +151,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -176,7 +176,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -201,7 +201,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -233,7 +233,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -261,7 +261,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -286,7 +286,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -311,7 +311,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -336,7 +336,7 @@ public partial interface IConnectionMonitorsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs index 22d9c1b1b7c2e..bab1ff811c570 100644 --- a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs @@ -52,19 +52,20 @@ public partial interface INetworkManagementClient : System.IDisposable string SubscriptionId { get; set; } /// - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running - /// Operations. Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated - /// and included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } @@ -219,6 +220,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IPublicIPAddressesOperations PublicIPAddresses { get; } + /// + /// Gets the IPublicIPPrefixesOperations. + /// + IPublicIPPrefixesOperations PublicIPPrefixes { get; } + /// /// Gets the IRouteFiltersOperations. /// @@ -314,6 +320,16 @@ public partial interface INetworkManagementClient : System.IDisposable /// IVpnConnectionsOperations VpnConnections { get; } + /// + /// Gets the IServiceEndpointPoliciesOperations. + /// + IServiceEndpointPoliciesOperations ServiceEndpointPolicies { get; } + + /// + /// Gets the IServiceEndpointPolicyDefinitionsOperations. + /// + IServiceEndpointPolicyDefinitionsOperations ServiceEndpointPolicyDefinitions { get; } + /// /// Checks whether a domain name in the cloudapp.azure.com zone is /// available for use. diff --git a/src/SDKs/Network/Management.Network/Generated/INetworkWatchersOperations.cs b/src/SDKs/Network/Management.Network/Generated/INetworkWatchersOperations.cs index 2a116d9fb8d84..826822974aa07 100644 --- a/src/SDKs/Network/Management.Network/Generated/INetworkWatchersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/INetworkWatchersOperations.cs @@ -42,7 +42,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -67,7 +67,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -92,7 +92,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -117,7 +117,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -139,7 +139,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,7 +158,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -186,7 +186,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -215,7 +215,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -243,7 +243,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -272,7 +272,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -300,7 +300,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -330,7 +330,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -359,7 +359,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -389,7 +389,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -420,7 +420,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -449,7 +449,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -478,7 +478,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -489,6 +489,34 @@ public partial interface INetworkWatchersOperations /// Task> ListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get network configuration diagnostic. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + /// + /// 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> GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Deletes the specified network watcher resource. /// /// @@ -503,7 +531,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -529,7 +557,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -557,7 +585,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -586,7 +614,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -614,7 +642,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -644,7 +672,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -673,7 +701,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -703,7 +731,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -734,7 +762,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -763,7 +791,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -792,7 +820,7 @@ public partial interface INetworkWatchersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -802,5 +830,33 @@ public partial interface INetworkWatchersOperations /// Thrown when a required parameter is null /// Task> BeginListAvailableProvidersWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, AvailableProvidersListParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get network configuration diagnostic. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + /// + /// 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> BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Network/Management.Network/Generated/IPacketCapturesOperations.cs b/src/SDKs/Network/Management.Network/Generated/IPacketCapturesOperations.cs index f1b707c3fda2b..dcdf47833d61f 100644 --- a/src/SDKs/Network/Management.Network/Generated/IPacketCapturesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/IPacketCapturesOperations.cs @@ -44,7 +44,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -72,7 +72,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -100,7 +100,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -125,7 +125,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -150,7 +150,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -176,7 +176,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -207,7 +207,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -235,7 +235,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -260,7 +260,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -285,7 +285,7 @@ public partial interface IPacketCapturesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/src/SDKs/Network/Management.Network/Generated/IPublicIPPrefixesOperations.cs b/src/SDKs/Network/Management.Network/Generated/IPublicIPPrefixesOperations.cs new file mode 100644 index 0000000000000..c51e13e12a0ed --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IPublicIPPrefixesOperations.cs @@ -0,0 +1,298 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// PublicIPPrefixesOperations operations. + /// + public partial interface IPublicIPPrefixesOperations + { + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// 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 publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIPPrefx. + /// + /// + /// Expands referenced resources. + /// + /// + /// 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 publicIpPrefixName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix + /// 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 publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates public IP prefix tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix 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 publicIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the public IP prefixes 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>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all public IP prefixes 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>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// 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 publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix + /// 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 publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates public IP prefix tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix 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 publicIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the public IP prefixes 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>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all public IP prefixes 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IServiceEndpointPoliciesOperations.cs b/src/SDKs/Network/Management.Network/Generated/IServiceEndpointPoliciesOperations.cs new file mode 100644 index 0000000000000..76b3039e0430a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IServiceEndpointPoliciesOperations.cs @@ -0,0 +1,299 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ServiceEndpointPoliciesOperations operations. + /// + public partial interface IServiceEndpointPoliciesOperations + { + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// 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 serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified service Endpoint Policies in a specified + /// resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Expands referenced resources. + /// + /// + /// 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 serviceEndpointPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// 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 serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the service endpoint policies 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 service endpoint Policies 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 service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// 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 serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// 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 serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the service endpoint policies 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 service endpoint Policies 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/IServiceEndpointPolicyDefinitionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IServiceEndpointPolicyDefinitionsOperations.cs new file mode 100644 index 0000000000000..dade1976c7f0b --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IServiceEndpointPolicyDefinitionsOperations.cs @@ -0,0 +1,221 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ServiceEndpointPolicyDefinitionsOperations operations. + /// + public partial interface IServiceEndpointPolicyDefinitionsOperations + { + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// 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 serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the specified service endpoint policy definitions from service + /// endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The name of the service endpoint policy definition 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> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a service endpoint policy definition in the + /// specified service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// 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 serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all service endpoint policy definitions in a service end point + /// policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// 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 serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a service endpoint policy definition in the + /// specified service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// 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 serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all service endpoint policy definitions in a service end point + /// policy. + /// + /// + /// 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/InboundNatRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs index 86454b4f32b12..33f5ba9f1caa5 100644 --- a/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs @@ -94,7 +94,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -323,7 +323,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -748,7 +748,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs index 09d20879c6287..8f2e2461339e7 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index 5aef24525adec..b8490af1a795a 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs index f7edf3b001e07..02f763dae2b39 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs index a6b0a938762c4..1818d1a71582b 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs index c70baa671258b..440040dcb5c1f 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs index d92244d7e1e32..6ed991a8fe7a5 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs @@ -119,7 +119,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +726,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs index 51e643a03390d..f3bfb71f75043 100644 --- a/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs @@ -127,7 +127,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -568,7 +568,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -791,7 +791,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -981,7 +981,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/Models/BackendAddressPool.cs b/src/SDKs/Network/Management.Network/Generated/Models/BackendAddressPool.cs index 0f9f9ac79867c..575e25e063cfb 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/BackendAddressPool.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/BackendAddressPool.cs @@ -39,7 +39,7 @@ public BackendAddressPool() /// to IP addresses defined in network interfaces. /// Gets load balancing rules that use /// this backend address pool. - /// Gets outbound rules that use this + /// Gets outbound rules that use this /// backend address pool. /// Get provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', @@ -49,12 +49,12 @@ public BackendAddressPool() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public BackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundNatRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public BackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { BackendIPConfigurations = backendIPConfigurations; LoadBalancingRules = loadBalancingRules; - OutboundNatRule = outboundNatRule; + OutboundRule = outboundRule; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -82,8 +82,8 @@ public BackendAddressPool() /// /// Gets outbound rules that use this backend address pool. /// - [JsonProperty(PropertyName = "properties.outboundNatRule")] - public SubResource OutboundNatRule { get; private set; } + [JsonProperty(PropertyName = "properties.outboundRule")] + public SubResource OutboundRule { get; private set; } /// /// Gets or sets get provisioning state of the public IP resource. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ConnectionStateSnapshot.cs b/src/SDKs/Network/Management.Network/Generated/Models/ConnectionStateSnapshot.cs index f7fc5bf898e63..ed3fc7cd98230 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ConnectionStateSnapshot.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ConnectionStateSnapshot.cs @@ -40,14 +40,24 @@ public ConnectionStateSnapshot() /// Connectivity analysis evaluation /// state. Possible values include: 'NotStarted', 'InProgress', /// 'Completed' + /// Average latency in ms. + /// Minimum latency in ms. + /// Maximum latency in ms. + /// The number of sent probes. + /// The number of failed probes. /// List of hops between the source and the /// destination. - public ConnectionStateSnapshot(string connectionState = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string evaluationState = default(string), IList hops = default(IList)) + public ConnectionStateSnapshot(string connectionState = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string evaluationState = default(string), int? avgLatencyInMs = default(int?), int? minLatencyInMs = default(int?), int? maxLatencyInMs = default(int?), int? probesSent = default(int?), int? probesFailed = default(int?), IList hops = default(IList)) { ConnectionState = connectionState; StartTime = startTime; EndTime = endTime; EvaluationState = evaluationState; + AvgLatencyInMs = avgLatencyInMs; + MinLatencyInMs = minLatencyInMs; + MaxLatencyInMs = maxLatencyInMs; + ProbesSent = probesSent; + ProbesFailed = probesFailed; Hops = hops; CustomInit(); } @@ -83,6 +93,36 @@ public ConnectionStateSnapshot() [JsonProperty(PropertyName = "evaluationState")] public string EvaluationState { get; set; } + /// + /// Gets or sets average latency in ms. + /// + [JsonProperty(PropertyName = "avgLatencyInMs")] + public int? AvgLatencyInMs { get; set; } + + /// + /// Gets or sets minimum latency in ms. + /// + [JsonProperty(PropertyName = "minLatencyInMs")] + public int? MinLatencyInMs { get; set; } + + /// + /// Gets or sets maximum latency in ms. + /// + [JsonProperty(PropertyName = "maxLatencyInMs")] + public int? MaxLatencyInMs { get; set; } + + /// + /// Gets or sets the number of sent probes. + /// + [JsonProperty(PropertyName = "probesSent")] + public int? ProbesSent { get; set; } + + /// + /// Gets or sets the number of failed probes. + /// + [JsonProperty(PropertyName = "probesFailed")] + public int? ProbesFailed { get; set; } + /// /// Gets list of hops between the source and the destination. /// diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ErrorResponse.cs b/src/SDKs/Network/Management.Network/Generated/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..01debe446c6d4 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ErrorResponse.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 error object. + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// Error + public ErrorResponse(ErrorDetails error = default(ErrorDetails)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetails Error { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ErrorResponseException.cs b/src/SDKs/Network/Management.Network/Generated/Models/ErrorResponseException.cs new file mode 100644 index 0000000000000..3a2e492022401 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/EvaluatedNetworkSecurityGroup.cs b/src/SDKs/Network/Management.Network/Generated/Models/EvaluatedNetworkSecurityGroup.cs new file mode 100644 index 0000000000000..ddd4d9590a2aa --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/EvaluatedNetworkSecurityGroup.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Results of network security group evaluation. + /// + public partial class EvaluatedNetworkSecurityGroup + { + /// + /// Initializes a new instance of the EvaluatedNetworkSecurityGroup + /// class. + /// + public EvaluatedNetworkSecurityGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EvaluatedNetworkSecurityGroup + /// class. + /// + /// Network security group + /// ID. + /// List of network security rules + /// evaluation results. + public EvaluatedNetworkSecurityGroup(string networkSecurityGroupId = default(string), MatchedRule matchedRule = default(MatchedRule), IList rulesEvaluationResult = default(IList)) + { + NetworkSecurityGroupId = networkSecurityGroupId; + MatchedRule = matchedRule; + RulesEvaluationResult = rulesEvaluationResult; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network security group ID. + /// + [JsonProperty(PropertyName = "networkSecurityGroupId")] + public string NetworkSecurityGroupId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "matchedRule")] + public MatchedRule MatchedRule { get; set; } + + /// + /// Gets list of network security rules evaluation results. + /// + [JsonProperty(PropertyName = "rulesEvaluationResult")] + public IList RulesEvaluationResult { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuit.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuit.cs index 26030b8c11dc9..83f210fb9886e 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuit.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuit.cs @@ -60,9 +60,11 @@ public ExpressRouteCircuit() /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. /// The GatewayManager Etag. + /// Flag to enable Global Reach on the + /// circuit. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), IList authorizations = default(IList), IList peerings = default(IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), string etag = default(string)) + public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), IList authorizations = default(IList), IList peerings = default(IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), bool? allowGlobalReach = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; @@ -76,6 +78,7 @@ public ExpressRouteCircuit() ServiceProviderProperties = serviceProviderProperties; ProvisioningState = provisioningState; GatewayManagerEtag = gatewayManagerEtag; + AllowGlobalReach = allowGlobalReach; Etag = etag; CustomInit(); } @@ -155,6 +158,12 @@ public ExpressRouteCircuit() [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } + /// + /// Gets or sets flag to enable Global Reach on the circuit. + /// + [JsonProperty(PropertyName = "properties.allowGlobalReach")] + public bool? AllowGlobalReach { 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/FrontendIpConfiguration.cs b/src/SDKs/Network/Management.Network/Generated/Models/FrontendIpConfiguration.cs index fe5d8bb8de4e5..a58dea739a46f 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/FrontendIpConfiguration.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/FrontendIpConfiguration.cs @@ -39,8 +39,8 @@ public FrontendIPConfiguration() /// use this frontend IP. /// Read only. Inbound pools URIs that /// use this frontend IP. - /// Read only. Outbound rules URIs that - /// use this frontend IP. + /// Read only. Outbound rules URIs that use + /// this frontend IP. /// Gets load balancing rules URIs /// that use this frontend IP. /// The private IP address of the IP @@ -51,6 +51,8 @@ public FrontendIPConfiguration() /// The reference of the subnet resource. /// The reference of the Public IP /// resource. + /// The reference of the Public IP Prefix + /// resource. /// Gets the provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. @@ -61,17 +63,18 @@ public FrontendIPConfiguration() /// the resource is updated. /// A list of availability zones denoting the IP /// allocated for the resource needs to come from. - public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string), IList zones = default(IList)) + public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), SubResource publicIPPrefix = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), IList zones = default(IList)) : base(id) { InboundNatRules = inboundNatRules; InboundNatPools = inboundNatPools; - OutboundNatRules = outboundNatRules; + OutboundRules = outboundRules; LoadBalancingRules = loadBalancingRules; PrivateIPAddress = privateIPAddress; PrivateIPAllocationMethod = privateIPAllocationMethod; Subnet = subnet; PublicIPAddress = publicIPAddress; + PublicIPPrefix = publicIPPrefix; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -99,8 +102,8 @@ public FrontendIPConfiguration() /// /// Gets read only. Outbound rules URIs that use this frontend IP. /// - [JsonProperty(PropertyName = "properties.outboundNatRules")] - public IList OutboundNatRules { get; private set; } + [JsonProperty(PropertyName = "properties.outboundRules")] + public IList OutboundRules { get; private set; } /// /// Gets load balancing rules URIs that use this frontend IP. @@ -134,6 +137,12 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } + /// + /// Gets or sets the reference of the Public IP Prefix resource. + /// + [JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix { get; set; } + /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/InboundNatPool.cs b/src/SDKs/Network/Management.Network/Generated/Models/InboundNatPool.cs index e5f856efd337f..650d42fb2ce9a 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/InboundNatPool.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/InboundNatPool.cs @@ -56,6 +56,9 @@ public InboundNatPool() /// AlwaysOn Availability Group. This setting is required when using /// the SQL AlwaysOn Availability Groups in SQL server. This setting /// can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP + /// flow idle timeout or unexpected connection termination. This + /// element is only used when the protocol is set to TCP. /// Gets the provisioning state of the /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. @@ -64,7 +67,7 @@ public InboundNatPool() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public InboundNatPool(string protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public InboundNatPool(string protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; @@ -74,6 +77,7 @@ public InboundNatPool() BackendPort = backendPort; IdleTimeoutInMinutes = idleTimeoutInMinutes; EnableFloatingIP = enableFloatingIP; + EnableTcpReset = enableTcpReset; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -138,6 +142,14 @@ public InboundNatPool() [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } + /// + /// Gets or sets receive bidirectional TCP Reset on TCP flow idle + /// timeout or unexpected connection termination. This element is only + /// used when the protocol is set to TCP. + /// + [JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset { get; set; } + /// /// Gets the provisioning state of the PublicIP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/InboundNatRule.cs b/src/SDKs/Network/Management.Network/Generated/Models/InboundNatRule.cs index 0df3f03845258..6faa7f4df2981 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/InboundNatRule.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/InboundNatRule.cs @@ -55,6 +55,9 @@ public InboundNatRule() /// AlwaysOn Availability Group. This setting is required when using /// the SQL AlwaysOn Availability Groups in SQL server. This setting /// can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP + /// flow idle timeout or unexpected connection termination. This + /// element is only used when the protocol is set to TCP. /// Gets the provisioning state of the /// public IP resource. Possible values are: 'Updating', 'Deleting', /// and 'Failed'. @@ -63,7 +66,7 @@ public InboundNatRule() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public InboundNatRule(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public InboundNatRule(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; @@ -73,6 +76,7 @@ public InboundNatRule() BackendPort = backendPort; IdleTimeoutInMinutes = idleTimeoutInMinutes; EnableFloatingIP = enableFloatingIP; + EnableTcpReset = enableTcpReset; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -137,6 +141,14 @@ public InboundNatRule() [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } + /// + /// Gets or sets receive bidirectional TCP Reset on TCP flow idle + /// timeout or unexpected connection termination. This element is only + /// used when the protocol is set to TCP. + /// + [JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset { get; set; } + /// /// Gets the provisioning state of the public IP resource. Possible /// values are: 'Updating', 'Deleting', and 'Failed'. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IpTag.cs b/src/SDKs/Network/Management.Network/Generated/Models/IpTag.cs index f1461cba3650a..da9128c3f5f0a 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IpTag.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IpTag.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// Contains the IpTag associated with the public IP address + /// Contains the IpTag associated with the object /// public partial class IpTag { diff --git a/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancer.cs b/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancer.cs index f586df56566c3..760cd7af05aa6 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancer.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancer.cs @@ -65,7 +65,7 @@ public LoadBalancer() /// associated with individual virtual machines cannot reference an /// inbound NAT pool. They have to reference individual inbound NAT /// rules. - /// The outbound NAT rules. + /// The outbound rules. /// The resource GUID property of the load /// balancer resource. /// Gets the provisioning state of the @@ -73,7 +73,7 @@ public LoadBalancer() /// 'Failed'. /// A unique read-only string that changes whenever /// the resource is updated. - public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), LoadBalancerSku sku = default(LoadBalancerSku), IList frontendIPConfigurations = default(IList), IList backendAddressPools = default(IList), IList loadBalancingRules = default(IList), IList probes = default(IList), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), LoadBalancerSku sku = default(LoadBalancerSku), IList frontendIPConfigurations = default(IList), IList backendAddressPools = default(IList), IList loadBalancingRules = default(IList), IList probes = default(IList), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundRules = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { Sku = sku; @@ -83,7 +83,7 @@ public LoadBalancer() Probes = probes; InboundNatRules = inboundNatRules; InboundNatPools = inboundNatPools; - OutboundNatRules = outboundNatRules; + OutboundRules = outboundRules; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; Etag = etag; @@ -156,10 +156,10 @@ public LoadBalancer() public IList InboundNatPools { get; set; } /// - /// Gets or sets the outbound NAT rules. + /// Gets or sets the outbound rules. /// - [JsonProperty(PropertyName = "properties.outboundNatRules")] - public IList OutboundNatRules { get; set; } + [JsonProperty(PropertyName = "properties.outboundRules")] + public IList OutboundRules { get; set; } /// /// Gets or sets the resource GUID property of the load balancer diff --git a/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancingRule.cs b/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancingRule.cs index a33ecc9d907f0..e2515385bd05d 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancingRule.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/LoadBalancingRule.cs @@ -62,6 +62,9 @@ public LoadBalancingRule() /// AlwaysOn Availability Group. This setting is required when using /// the SQL AlwaysOn Availability Groups in SQL server. This setting /// can't be changed after you create the endpoint. + /// Receive bidirectional TCP Reset on TCP + /// flow idle timeout or unexpected connection termination. This + /// element is only used when the protocol is set to TCP. /// Configures SNAT for the VMs in /// the backend pool to use the publicIP address specified in the /// frontend of the load balancing rule. @@ -73,7 +76,7 @@ public LoadBalancingRule() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? disableOutboundSnat = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; @@ -85,6 +88,7 @@ public LoadBalancingRule() BackendPort = backendPort; IdleTimeoutInMinutes = idleTimeoutInMinutes; EnableFloatingIP = enableFloatingIP; + EnableTcpReset = enableTcpReset; DisableOutboundSnat = disableOutboundSnat; ProvisioningState = provisioningState; Name = name; @@ -166,6 +170,14 @@ public LoadBalancingRule() [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } + /// + /// Gets or sets receive bidirectional TCP Reset on TCP flow idle + /// timeout or unexpected connection termination. This element is only + /// used when the protocol is set to TCP. + /// + [JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset { get; set; } + /// /// Gets or sets configures SNAT for the VMs in the backend pool to use /// the publicIP address specified in the frontend of the load diff --git a/src/SDKs/Network/Management.Network/Generated/Models/MatchedRule.cs b/src/SDKs/Network/Management.Network/Generated/Models/MatchedRule.cs new file mode 100644 index 0000000000000..3292892dc3afe --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/MatchedRule.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Matched rule. + /// + public partial class MatchedRule + { + /// + /// Initializes a new instance of the MatchedRule class. + /// + public MatchedRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MatchedRule class. + /// + /// Name of the matched network security + /// rule. + /// The network traffic is allowed or denied. + /// Possible values are 'Allow' and 'Deny'. + public MatchedRule(string ruleName = default(string), string action = default(string)) + { + RuleName = ruleName; + Action = action; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the matched network security rule. + /// + [JsonProperty(PropertyName = "ruleName")] + public string RuleName { get; set; } + + /// + /// Gets or sets the network traffic is allowed or denied. Possible + /// values are 'Allow' and 'Deny'. + /// + [JsonProperty(PropertyName = "action")] + public string Action { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticParameters.cs b/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticParameters.cs new file mode 100644 index 0000000000000..fda845130ebb0 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticParameters.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Parameters to get network configuration diagnostic. + /// + public partial class NetworkConfigurationDiagnosticParameters + { + /// + /// Initializes a new instance of the + /// NetworkConfigurationDiagnosticParameters class. + /// + public NetworkConfigurationDiagnosticParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkConfigurationDiagnosticParameters class. + /// + /// The ID of the target resource to + /// perform network configuration diagnostic. Valid options are VM, + /// NetworkInterface, VMSS/NetworkInterface and Application + /// Gateway. + /// List of traffic queries. + public NetworkConfigurationDiagnosticParameters(string targetResourceId, IList queries) + { + TargetResourceId = targetResourceId; + Queries = queries; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of the target resource to perform network + /// configuration diagnostic. Valid options are VM, NetworkInterface, + /// VMSS/NetworkInterface and Application Gateway. + /// + [JsonProperty(PropertyName = "targetResourceId")] + public string TargetResourceId { get; set; } + + /// + /// Gets or sets list of traffic queries. + /// + [JsonProperty(PropertyName = "queries")] + public IList Queries { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetResourceId"); + } + if (Queries == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Queries"); + } + if (Queries != null) + { + foreach (var element in Queries) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticResponse.cs b/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticResponse.cs new file mode 100644 index 0000000000000..d5e89021ba46f --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Results of network configuration diagnostic on the target resource. + /// + public partial class NetworkConfigurationDiagnosticResponse + { + /// + /// Initializes a new instance of the + /// NetworkConfigurationDiagnosticResponse class. + /// + public NetworkConfigurationDiagnosticResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkConfigurationDiagnosticResponse class. + /// + /// List of network configuration diagnostic + /// results. + public NetworkConfigurationDiagnosticResponse(IList results = default(IList)) + { + Results = results; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of network configuration diagnostic results. + /// + [JsonProperty(PropertyName = "results")] + public IList Results { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticResult.cs new file mode 100644 index 0000000000000..4b176d35f87a0 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/NetworkConfigurationDiagnosticResult.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network configuration diagnostic result corresponded to provided + /// traffic query. + /// + public partial class NetworkConfigurationDiagnosticResult + { + /// + /// Initializes a new instance of the + /// NetworkConfigurationDiagnosticResult class. + /// + public NetworkConfigurationDiagnosticResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkConfigurationDiagnosticResult class. + /// + public NetworkConfigurationDiagnosticResult(TrafficQuery trafficQuery = default(TrafficQuery), NetworkSecurityGroupResult networkSecurityGroupResult = default(NetworkSecurityGroupResult)) + { + TrafficQuery = trafficQuery; + NetworkSecurityGroupResult = networkSecurityGroupResult; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "trafficQuery")] + public TrafficQuery TrafficQuery { get; set; } + + /// + /// + [JsonProperty(PropertyName = "networkSecurityGroupResult")] + public NetworkSecurityGroupResult NetworkSecurityGroupResult { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TrafficQuery != null) + { + TrafficQuery.Validate(); + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/NetworkSecurityGroupResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/NetworkSecurityGroupResult.cs new file mode 100644 index 0000000000000..30eb92ee0380a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/NetworkSecurityGroupResult.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network configuration diagnostic result corresponded provided traffic + /// query. + /// + public partial class NetworkSecurityGroupResult + { + /// + /// Initializes a new instance of the NetworkSecurityGroupResult class. + /// + public NetworkSecurityGroupResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkSecurityGroupResult class. + /// + /// The network traffic is + /// allowed or denied. Possible values are 'Allow' and 'Deny'. Possible + /// values include: 'Allow', 'Deny' + /// List of results + /// network security groups diagnostic. + public NetworkSecurityGroupResult(string securityRuleAccessResult = default(string), IList evaluatedNetworkSecurityGroups = default(IList)) + { + SecurityRuleAccessResult = securityRuleAccessResult; + EvaluatedNetworkSecurityGroups = evaluatedNetworkSecurityGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the network traffic is allowed or denied. Possible + /// values are 'Allow' and 'Deny'. Possible values include: 'Allow', + /// 'Deny' + /// + [JsonProperty(PropertyName = "securityRuleAccessResult")] + public string SecurityRuleAccessResult { get; set; } + + /// + /// Gets list of results network security groups diagnostic. + /// + [JsonProperty(PropertyName = "evaluatedNetworkSecurityGroups")] + public IList EvaluatedNetworkSecurityGroups { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/NetworkSecurityRulesEvaluationResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/NetworkSecurityRulesEvaluationResult.cs new file mode 100644 index 0000000000000..1db1a657504ea --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/NetworkSecurityRulesEvaluationResult.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network security rules evaluation result. + /// + public partial class NetworkSecurityRulesEvaluationResult + { + /// + /// Initializes a new instance of the + /// NetworkSecurityRulesEvaluationResult class. + /// + public NetworkSecurityRulesEvaluationResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkSecurityRulesEvaluationResult class. + /// + /// Name of the network security rule. + /// Value indicating whether protocol is + /// matched. + /// Value indicating whether source is + /// matched. + /// Value indicating whether source + /// port is matched. + /// Value indicating whether + /// destination is matched. + /// Value indicating whether + /// destination port is matched. + public NetworkSecurityRulesEvaluationResult(string name = default(string), bool? protocolMatched = default(bool?), bool? sourceMatched = default(bool?), bool? sourcePortMatched = default(bool?), bool? destinationMatched = default(bool?), bool? destinationPortMatched = default(bool?)) + { + Name = name; + ProtocolMatched = protocolMatched; + SourceMatched = sourceMatched; + SourcePortMatched = sourcePortMatched; + DestinationMatched = destinationMatched; + DestinationPortMatched = destinationPortMatched; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the network security rule. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets value indicating whether protocol is matched. + /// + [JsonProperty(PropertyName = "protocolMatched")] + public bool? ProtocolMatched { get; set; } + + /// + /// Gets or sets value indicating whether source is matched. + /// + [JsonProperty(PropertyName = "sourceMatched")] + public bool? SourceMatched { get; set; } + + /// + /// Gets or sets value indicating whether source port is matched. + /// + [JsonProperty(PropertyName = "sourcePortMatched")] + public bool? SourcePortMatched { get; set; } + + /// + /// Gets or sets value indicating whether destination is matched. + /// + [JsonProperty(PropertyName = "destinationMatched")] + public bool? DestinationMatched { get; set; } + + /// + /// Gets or sets value indicating whether destination port is matched. + /// + [JsonProperty(PropertyName = "destinationPortMatched")] + public bool? DestinationPortMatched { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/OutboundNatRule.cs b/src/SDKs/Network/Management.Network/Generated/Models/OutboundRule.cs similarity index 64% rename from src/SDKs/Network/Management.Network/Generated/Models/OutboundNatRule.cs rename to src/SDKs/Network/Management.Network/Generated/Models/OutboundRule.cs index 3076ff38ab632..2525c154abf48 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/OutboundNatRule.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/OutboundRule.cs @@ -18,45 +18,55 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// Outbound NAT pool of the load balancer. + /// Outbound pool of the load balancer. /// [Rest.Serialization.JsonTransformation] - public partial class OutboundNatRule : SubResource + public partial class OutboundRule : SubResource { /// - /// Initializes a new instance of the OutboundNatRule class. + /// Initializes a new instance of the OutboundRule class. /// - public OutboundNatRule() + public OutboundRule() { CustomInit(); } /// - /// Initializes a new instance of the OutboundNatRule class. + /// Initializes a new instance of the OutboundRule class. /// + /// The Frontend IP addresses of + /// the load balancer. /// A reference to a pool of DIPs. /// Outbound traffic is randomly load balanced across IPs in the /// backend IPs. + /// Protocol - TCP, UDP or All. Possible values + /// include: 'Tcp', 'Udp', 'All' /// Resource ID. /// The number of outbound ports /// to be used for NAT. - /// The Frontend IP addresses of - /// the load balancer. /// Gets the provisioning state of the /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. + /// Receive bidirectional TCP Reset on TCP + /// flow idle timeout or unexpected connection termination. This + /// element is only used when the protocol is set to TCP. + /// The timeout for the TCP idle + /// connection /// The name of the resource that is unique within a /// resource group. This name can be used to access the /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public OutboundNatRule(SubResource backendAddressPool, string id = default(string), int? allocatedOutboundPorts = default(int?), IList frontendIPConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public OutboundRule(IList frontendIPConfigurations, SubResource backendAddressPool, string protocol, string id = default(string), int? allocatedOutboundPorts = default(int?), string provisioningState = default(string), bool? enableTcpReset = default(bool?), int? idleTimeoutInMinutes = default(int?), string name = default(string), string etag = default(string)) : base(id) { AllocatedOutboundPorts = allocatedOutboundPorts; FrontendIPConfigurations = frontendIPConfigurations; BackendAddressPool = backendAddressPool; ProvisioningState = provisioningState; + Protocol = protocol; + EnableTcpReset = enableTcpReset; + IdleTimeoutInMinutes = idleTimeoutInMinutes; Name = name; Etag = etag; CustomInit(); @@ -93,6 +103,27 @@ public OutboundNatRule() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } + /// + /// Gets or sets protocol - TCP, UDP or All. Possible values include: + /// 'Tcp', 'Udp', 'All' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets receive bidirectional TCP Reset on TCP flow idle + /// timeout or unexpected connection termination. This element is only + /// used when the protocol is set to TCP. + /// + [JsonProperty(PropertyName = "properties.enableTcpReset")] + public bool? EnableTcpReset { get; set; } + + /// + /// Gets or sets the timeout for the TCP idle connection + /// + [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] + public int? IdleTimeoutInMinutes { get; set; } + /// /// Gets or sets the name of the resource that is unique within a /// resource group. This name can be used to access the resource. @@ -115,10 +146,18 @@ public OutboundNatRule() /// public virtual void Validate() { + if (FrontendIPConfigurations == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "FrontendIPConfigurations"); + } if (BackendAddressPool == null) { throw new ValidationException(ValidationRules.CannotBeNull, "BackendAddressPool"); } + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } } } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefix.cs b/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefix.cs new file mode 100644 index 0000000000000..d76776f908aa0 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefix.cs @@ -0,0 +1,150 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Public IP prefix resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PublicIPPrefix : Resource + { + /// + /// Initializes a new instance of the PublicIPPrefix class. + /// + public PublicIPPrefix() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PublicIPPrefix class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The public IP prefix SKU. + /// The public IP address version. + /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: + /// 'IPv4', 'IPv6' + /// The list of tags associated with the public IP + /// prefix. + /// The Length of the Public IP + /// Prefix. + /// The allocated Prefix + /// The list of all referenced + /// PublicIPAddresses + /// The resource GUID property of the public + /// IP prefix resource. + /// The provisioning state of the + /// Public IP prefix resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A list of availability zones denoting the IP + /// allocated for the resource needs to come from. + public PublicIPPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PublicIPPrefixSku sku = default(PublicIPPrefixSku), string publicIPAddressVersion = default(string), IList ipTags = default(IList), int? prefixLength = default(int?), string ipPrefix = default(string), IList publicIPAddresses = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) + : base(id, name, type, location, tags) + { + Sku = sku; + PublicIPAddressVersion = publicIPAddressVersion; + IpTags = ipTags; + PrefixLength = prefixLength; + IpPrefix = ipPrefix; + PublicIPAddresses = publicIPAddresses; + ResourceGuid = resourceGuid; + ProvisioningState = provisioningState; + Etag = etag; + Zones = zones; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the public IP prefix SKU. + /// + [JsonProperty(PropertyName = "sku")] + public PublicIPPrefixSku Sku { get; set; } + + /// + /// Gets or sets the public IP address version. Possible values are: + /// 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + /// + [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] + public string PublicIPAddressVersion { get; set; } + + /// + /// Gets or sets the list of tags associated with the public IP prefix. + /// + [JsonProperty(PropertyName = "properties.ipTags")] + public IList IpTags { get; set; } + + /// + /// Gets or sets the Length of the Public IP Prefix. + /// + [JsonProperty(PropertyName = "properties.prefixLength")] + public int? PrefixLength { get; set; } + + /// + /// Gets or sets the allocated Prefix + /// + [JsonProperty(PropertyName = "properties.ipPrefix")] + public string IpPrefix { get; set; } + + /// + /// Gets or sets the list of all referenced PublicIPAddresses + /// + [JsonProperty(PropertyName = "properties.publicIPAddresses")] + public IList PublicIPAddresses { get; set; } + + /// + /// Gets or sets the resource GUID property of the public IP prefix + /// resource. + /// + [JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid { get; set; } + + /// + /// Gets or sets the provisioning state of the Public IP prefix + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + /// + /// Gets or sets a list of availability zones denoting the IP allocated + /// for the resource needs to come from. + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefixSku.cs b/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefixSku.cs new file mode 100644 index 0000000000000..27d8b05e5940d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefixSku.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SKU of a public IP prefix + /// + public partial class PublicIPPrefixSku + { + /// + /// Initializes a new instance of the PublicIPPrefixSku class. + /// + public PublicIPPrefixSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PublicIPPrefixSku class. + /// + /// Name of a public IP prefix SKU. Possible values + /// include: 'Standard' + public PublicIPPrefixSku(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of a public IP prefix SKU. Possible values + /// include: 'Standard' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefixSkuName.cs b/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefixSkuName.cs new file mode 100644 index 0000000000000..8b38a2db37afc --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/PublicIPPrefixSkuName.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for PublicIPPrefixSkuName. + /// + public static class PublicIPPrefixSkuName + { + public const string Standard = "Standard"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/PublicIpAddress.cs b/src/SDKs/Network/Management.Network/Generated/Models/PublicIpAddress.cs index f8f5d7306bc25..373ae317c2f49 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/PublicIpAddress.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/PublicIpAddress.cs @@ -54,6 +54,8 @@ public PublicIPAddress() /// address. /// The IP address associated with the public /// IP address resource. + /// The Public IP Prefix this Public IP + /// Address should be allocated from. /// The idle timeout of the public /// IP address. /// The resource GUID property of the public @@ -65,7 +67,7 @@ public PublicIPAddress() /// the resource is updated. /// A list of availability zones denoting the IP /// allocated for the resource needs to come from. - public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PublicIPAddressSku sku = default(PublicIPAddressSku), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), IList ipTags = default(IList), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) + public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PublicIPAddressSku sku = default(PublicIPAddressSku), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), IList ipTags = default(IList), string ipAddress = default(string), SubResource publicIPPrefix = default(SubResource), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) : base(id, name, type, location, tags) { Sku = sku; @@ -75,6 +77,7 @@ public PublicIPAddress() DnsSettings = dnsSettings; IpTags = ipTags; IpAddress = ipAddress; + PublicIPPrefix = publicIPPrefix; IdleTimeoutInMinutes = idleTimeoutInMinutes; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; @@ -136,6 +139,13 @@ public PublicIPAddress() [JsonProperty(PropertyName = "properties.ipAddress")] public string IpAddress { get; set; } + /// + /// Gets or sets the Public IP Prefix this Public IP Address should be + /// allocated from. + /// + [JsonProperty(PropertyName = "properties.publicIPPrefix")] + public SubResource PublicIPPrefix { get; set; } + /// /// Gets or sets the idle timeout of the public IP address. /// diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ReferencedPublicIpAddress.cs b/src/SDKs/Network/Management.Network/Generated/Models/ReferencedPublicIpAddress.cs new file mode 100644 index 0000000000000..a83efd06ab2c8 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ReferencedPublicIpAddress.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ReferencedPublicIpAddress + { + /// + /// Initializes a new instance of the ReferencedPublicIpAddress class. + /// + public ReferencedPublicIpAddress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReferencedPublicIpAddress class. + /// + /// The PublicIPAddress Reference + public ReferencedPublicIpAddress(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the PublicIPAddress Reference + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPolicy.cs b/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPolicy.cs new file mode 100644 index 0000000000000..f7a8d1ed3e435 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPolicy.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Service End point policy resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ServiceEndpointPolicy : Resource + { + /// + /// Initializes a new instance of the ServiceEndpointPolicy class. + /// + public ServiceEndpointPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceEndpointPolicy class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A collection of + /// service endpoint policy definitions of the service endpoint + /// policy. + /// The resource GUID property of the + /// service endpoint policy resource. + /// The provisioning state of the + /// service endpoint policy. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ServiceEndpointPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList serviceEndpointPolicyDefinitions = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + : base(id, name, type, location, tags) + { + ServiceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; + ResourceGuid = resourceGuid; + ProvisioningState = provisioningState; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a collection of service endpoint policy definitions of + /// the service endpoint policy. + /// + [JsonProperty(PropertyName = "properties.serviceEndpointPolicyDefinitions")] + public IList ServiceEndpointPolicyDefinitions { get; set; } + + /// + /// Gets or sets the resource GUID property of the service endpoint + /// policy resource. + /// + [JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid { get; set; } + + /// + /// Gets or sets the provisioning state of the service endpoint policy. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPolicyDefinition.cs b/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPolicyDefinition.cs new file mode 100644 index 0000000000000..dd71a67e4fb68 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPolicyDefinition.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Service Endpoint policy definitions. + /// + [Rest.Serialization.JsonTransformation] + public partial class ServiceEndpointPolicyDefinition : SubResource + { + /// + /// Initializes a new instance of the ServiceEndpointPolicyDefinition + /// class. + /// + public ServiceEndpointPolicyDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceEndpointPolicyDefinition + /// class. + /// + /// Resource ID. + /// A description for this rule. Restricted + /// to 140 chars. + /// service endpoint name. + /// A list of service resources. + /// The provisioning state of the + /// service end point policy definition. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ServiceEndpointPolicyDefinition(string id = default(string), string description = default(string), string service = default(string), IList serviceResources = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + : base(id) + { + Description = description; + Service = service; + ServiceResources = serviceResources; + ProvisioningState = provisioningState; + Name = name; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets service endpoint name. + /// + [JsonProperty(PropertyName = "properties.service")] + public string Service { get; set; } + + /// + /// Gets or sets a list of service resources. + /// + [JsonProperty(PropertyName = "properties.serviceResources")] + public IList ServiceResources { get; set; } + + /// + /// Gets or sets the provisioning state of the service end point policy + /// definition. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs b/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs index 9a96a9142b21d..f1d547a851bb5 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs @@ -43,6 +43,8 @@ public Subnet() /// resource. /// An array of service /// endpoints. + /// An array of service endpoint + /// policies. /// Gets an array of references to the /// network interface IP configurations using subnet. /// Gets an array of references @@ -54,13 +56,14 @@ public Subnet() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList serviceEndpoints = default(IList), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList serviceEndpoints = default(IList), IList serviceEndpointPolicies = default(IList), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { AddressPrefix = addressPrefix; NetworkSecurityGroup = networkSecurityGroup; RouteTable = routeTable; ServiceEndpoints = serviceEndpoints; + ServiceEndpointPolicies = serviceEndpointPolicies; IpConfigurations = ipConfigurations; ResourceNavigationLinks = resourceNavigationLinks; ProvisioningState = provisioningState; @@ -98,6 +101,12 @@ public Subnet() [JsonProperty(PropertyName = "properties.serviceEndpoints")] public IList ServiceEndpoints { get; set; } + /// + /// Gets or sets an array of service endpoint policies. + /// + [JsonProperty(PropertyName = "properties.serviceEndpointPolicies")] + public IList ServiceEndpointPolicies { get; set; } + /// /// Gets an array of references to the network interface IP /// configurations using subnet. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/TrafficQuery.cs b/src/SDKs/Network/Management.Network/Generated/Models/TrafficQuery.cs new file mode 100644 index 0000000000000..5275bef3aec4e --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/TrafficQuery.cs @@ -0,0 +1,126 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Parameters to compare with network configuration. + /// + public partial class TrafficQuery + { + /// + /// Initializes a new instance of the TrafficQuery class. + /// + public TrafficQuery() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrafficQuery class. + /// + /// The direction of the traffic. Accepted + /// values are 'Inbound' and 'Outbound'. Possible values include: + /// 'Inbound', 'Outbound' + /// Protocol to be verified on. Accepted values + /// are '*', TCP, UDP. + /// Traffic source. Accepted values are '*', IP + /// Address/CIDR, Service Tag. + /// Traffic destination. Accepted values are: + /// '*', IP Address/CIDR, Service Tag. + /// Traffice destination port. Accepted + /// values are '*', port (for example, 3389) and port range (for + /// example, 80-100). + public TrafficQuery(string direction, string protocol, string source, string destination, string destinationPort) + { + Direction = direction; + Protocol = protocol; + Source = source; + Destination = destination; + DestinationPort = destinationPort; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the direction of the traffic. Accepted values are + /// 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + /// 'Outbound' + /// + [JsonProperty(PropertyName = "direction")] + public string Direction { get; set; } + + /// + /// Gets or sets protocol to be verified on. Accepted values are '*', + /// TCP, UDP. + /// + [JsonProperty(PropertyName = "protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets traffic source. Accepted values are '*', IP + /// Address/CIDR, Service Tag. + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; set; } + + /// + /// Gets or sets traffic destination. Accepted values are: '*', IP + /// Address/CIDR, Service Tag. + /// + [JsonProperty(PropertyName = "destination")] + public string Destination { get; set; } + + /// + /// Gets or sets traffice destination port. Accepted values are '*', + /// port (for example, 3389) and port range (for example, 80-100). + /// + [JsonProperty(PropertyName = "destinationPort")] + public string DestinationPort { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Source == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + } + if (Destination == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Destination"); + } + if (DestinationPort == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DestinationPort"); + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs index 831458ca0d430..6fb3b0dcb09a9 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -75,9 +75,11 @@ public VirtualNetworkGatewayConnection() /// The provisioning state of the /// VirtualNetworkGatewayConnection resource. Possible values are: /// 'Updating', 'Deleting', and 'Failed'. + /// Bypass ExpressRoute Gateway + /// for data forwarding /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; @@ -97,6 +99,7 @@ public VirtualNetworkGatewayConnection() IpsecPolicies = ipsecPolicies; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; + ExpressRouteGatewayBypass = expressRouteGatewayBypass; Etag = etag; CustomInit(); } @@ -217,6 +220,12 @@ public VirtualNetworkGatewayConnection() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets bypass ExpressRoute Gateway for data forwarding + /// + [JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass { 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/VirtualNetworkGatewayConnectionListEntity.cs b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs index cfe8a57ae9259..064ec69cad51e 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs @@ -75,9 +75,11 @@ public VirtualNetworkGatewayConnectionListEntity() /// The provisioning state of the /// VirtualNetworkGatewayConnection resource. Possible values are: /// 'Updating', 'Deleting', and 'Failed'. + /// Bypass ExpressRoute Gateway + /// for data forwarding /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VirtualNetworkGatewayConnectionListEntity(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkConnectionGatewayReference virtualNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), VirtualNetworkConnectionGatewayReference localNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public VirtualNetworkGatewayConnectionListEntity(VirtualNetworkConnectionGatewayReference virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkConnectionGatewayReference virtualNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), VirtualNetworkConnectionGatewayReference localNetworkGateway2 = default(VirtualNetworkConnectionGatewayReference), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; @@ -97,6 +99,7 @@ public VirtualNetworkGatewayConnectionListEntity() IpsecPolicies = ipsecPolicies; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; + ExpressRouteGatewayBypass = expressRouteGatewayBypass; Etag = etag; CustomInit(); } @@ -217,6 +220,12 @@ public VirtualNetworkGatewayConnectionListEntity() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets bypass ExpressRoute Gateway for data forwarding + /// + [JsonProperty(PropertyName = "properties.expressRouteGatewayBypass")] + public bool? ExpressRouteGatewayBypass { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs index c921a63d579c5..0e98ae43f198e 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs index 204f6e22789d6..fdfed5ed96f55 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs index 2a6c2e15c1ecb..2075d8917a82b 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs @@ -119,7 +119,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1839,7 +1839,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2022,7 +2022,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2248,7 +2248,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2449,7 +2449,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2643,7 +2643,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs index 6c16600409bc7..548aefb2181c3 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs @@ -56,19 +56,20 @@ public partial class NetworkManagementClient : ServiceClient - /// Gets or sets the preferred language for the response. + /// The preferred language for the response. /// public string AcceptLanguage { get; set; } /// - /// Gets or sets the retry timeout in seconds for Long Running Operations. - /// Default value is 30. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. /// public int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. /// public bool? GenerateClientRequestId { get; set; } @@ -222,6 +223,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IPublicIPAddressesOperations PublicIPAddresses { get; private set; } + /// + /// Gets the IPublicIPPrefixesOperations. + /// + public virtual IPublicIPPrefixesOperations PublicIPPrefixes { get; private set; } + /// /// Gets the IRouteFiltersOperations. /// @@ -317,6 +323,29 @@ public partial class NetworkManagementClient : ServiceClient public virtual IVpnConnectionsOperations VpnConnections { get; private set; } + /// + /// Gets the IServiceEndpointPoliciesOperations. + /// + public virtual IServiceEndpointPoliciesOperations ServiceEndpointPolicies { get; private set; } + + /// + /// Gets the IServiceEndpointPolicyDefinitionsOperations. + /// + public virtual IServiceEndpointPolicyDefinitionsOperations ServiceEndpointPolicyDefinitions { get; private set; } + + /// + /// Initializes a new instance of the NetworkManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling NetworkManagementClient.Dispose(). False: will not dispose provided httpClient + protected NetworkManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -412,6 +441,33 @@ public NetworkManagementClient(ServiceClientCredentials credentials, params Dele } } + /// + /// Initializes a new instance of the NetworkManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling NetworkManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -548,6 +604,7 @@ private void Initialize() ConnectionMonitors = new ConnectionMonitorsOperations(this); Operations = new Operations(this); PublicIPAddresses = new PublicIPAddressesOperations(this); + PublicIPPrefixes = new PublicIPPrefixesOperations(this); RouteFilters = new RouteFiltersOperations(this); RouteFilterRules = new RouteFilterRulesOperations(this); RouteTables = new RouteTablesOperations(this); @@ -567,6 +624,8 @@ private void Initialize() HubVirtualNetworkConnections = new HubVirtualNetworkConnectionsOperations(this); VpnGateways = new VpnGatewaysOperations(this); VpnConnections = new VpnConnectionsOperations(this); + ServiceEndpointPolicies = new ServiceEndpointPoliciesOperations(this); + ServiceEndpointPolicyDefinitions = new ServiceEndpointPolicyDefinitionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; @@ -647,7 +706,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs index a31bba7a74715..c18776baa216f 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs @@ -119,7 +119,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -356,7 +356,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -728,7 +728,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1139,7 +1139,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs index 575f83d81e68f..39544657e327c 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs @@ -68,7 +68,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -193,14 +193,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -210,10 +209,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -291,7 +286,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -320,7 +315,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -405,14 +400,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -422,10 +416,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -510,7 +500,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -543,7 +533,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -635,14 +625,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -652,10 +641,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -712,7 +697,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -737,7 +722,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -820,14 +805,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -837,10 +821,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -894,7 +874,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -915,7 +895,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -996,14 +976,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1013,10 +992,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -1079,7 +1054,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1112,7 +1087,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1204,14 +1179,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1221,10 +1195,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -1527,6 +1497,31 @@ internal NetworkWatchersOperations(NetworkManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Get network configuration diagnostic. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Deletes the specified network watcher resource. /// @@ -1542,7 +1537,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1568,7 +1563,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1653,14 +1648,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1670,10 +1664,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -1719,7 +1709,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1756,7 +1746,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1848,14 +1838,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1865,10 +1854,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -1949,7 +1934,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1986,7 +1971,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2078,14 +2063,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2095,10 +2079,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -2179,7 +2159,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2216,7 +2196,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2308,14 +2288,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2325,10 +2304,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -2409,7 +2384,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2446,7 +2421,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2538,14 +2513,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2555,10 +2529,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -2639,7 +2609,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2676,7 +2646,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2768,14 +2738,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2785,10 +2754,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -2870,7 +2835,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2907,7 +2872,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2999,14 +2964,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3016,10 +2980,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -3102,7 +3062,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3139,7 +3099,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3231,14 +3191,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3248,10 +3207,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -3334,7 +3289,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3371,7 +3326,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3463,14 +3418,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3480,10 +3434,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -3565,7 +3515,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3602,7 +3552,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3694,14 +3644,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3711,10 +3660,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -3796,7 +3741,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3829,7 +3774,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3921,14 +3866,13 @@ internal NetworkWatchersOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3938,10 +3882,6 @@ internal NetworkWatchersOperations(NetworkManagementClient client) } 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); @@ -4004,5 +3944,230 @@ internal NetworkWatchersOperations(NetworkManagementClient client) return _result; } + /// + /// Get network configuration diagnostic. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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> BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkWatcherName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkWatcherName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkWatcherName", networkWatcherName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginGetNetworkConfigurationDiagnostic", 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/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkWatcherName}", System.Uri.EscapeDataString(networkWatcherName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(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 != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 == 202) + { + _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/NetworkWatchersOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperationsExtensions.cs index 91bd6a8c963f8..a3b6d912a405c 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperationsExtensions.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperationsExtensions.cs @@ -776,6 +776,52 @@ public static AvailableProvidersList ListAvailableProviders(this INetworkWatcher } } + /// + /// Get network configuration diagnostic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + public static NetworkConfigurationDiagnosticResponse GetNetworkConfigurationDiagnostic(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) + { + return operations.GetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Get network configuration diagnostic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + /// + /// The cancellation token. + /// + public static async Task GetNetworkConfigurationDiagnosticAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Deletes the specified network watcher resource. /// @@ -1289,5 +1335,51 @@ public static AvailableProvidersList BeginListAvailableProviders(this INetworkWa } } + /// + /// Get network configuration diagnostic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + public static NetworkConfigurationDiagnosticResponse BeginGetNetworkConfigurationDiagnostic(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) + { + return operations.BeginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Get network configuration diagnostic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network watcher. + /// + /// + /// Parameters to get network configuration diagnostic. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetNetworkConfigurationDiagnosticAsync(this INetworkWatchersOperations operations, string resourceGroupName, string networkWatcherName, NetworkConfigurationDiagnosticParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetNetworkConfigurationDiagnosticWithHttpMessagesAsync(resourceGroupName, networkWatcherName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/src/SDKs/Network/Management.Network/Generated/Operations.cs b/src/SDKs/Network/Management.Network/Generated/Operations.cs index 0c32d9b61b1be..d2829244ffec4 100644 --- a/src/SDKs/Network/Management.Network/Generated/Operations.cs +++ b/src/SDKs/Network/Management.Network/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs index 8b4f870855834..312d06a6d05ba 100644 --- a/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs @@ -96,7 +96,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -216,14 +216,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -233,10 +232,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) } 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); @@ -371,7 +366,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -400,7 +395,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -485,14 +480,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -502,10 +496,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) } 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); @@ -571,7 +561,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -612,7 +602,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -706,14 +696,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -723,10 +712,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) } 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); @@ -789,7 +774,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -819,7 +804,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -906,14 +891,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -923,10 +907,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) } 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); @@ -971,7 +951,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1001,7 +981,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,14 +1068,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1105,10 +1084,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) } 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); @@ -1153,7 +1128,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1186,7 +1161,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1273,14 +1248,13 @@ internal PacketCapturesOperations(NetworkManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1290,10 +1264,6 @@ internal PacketCapturesOperations(NetworkManagementClient client) } 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); diff --git a/src/SDKs/Network/Management.Network/Generated/PublicIPPrefixesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PublicIPPrefixesOperations.cs new file mode 100644 index 0000000000000..edd3c20b030ea --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/PublicIPPrefixesOperations.cs @@ -0,0 +1,1642 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// PublicIPPrefixesOperations operations. + /// + internal partial class PublicIPPrefixesOperations : IServiceOperations, IPublicIPPrefixesOperations + { + /// + /// Initializes a new instance of the PublicIPPrefixesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PublicIPPrefixesOperations(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 public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIPPrefx. + /// + /// + /// Expands referenced resources. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (publicIpPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); + 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/publicIPPrefixes/{publicIpPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + 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 static or dynamic public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates public IP prefix tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all the public IP prefixes 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>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all public IP prefixes 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>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "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/publicIPPrefixes").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// 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 publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (publicIpPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix 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 publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (publicIpPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates public IP prefix tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix 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 publicIpPrefixName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (publicIpPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpPrefixName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpPrefixName", publicIpPrefixName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(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; + } + + /// + /// Gets all the public IP prefixes 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>> ListAllNextWithHttpMessagesAsync(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, "ListAllNext", 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 public IP prefixes 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>> 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/PublicIPPrefixesOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/PublicIPPrefixesOperationsExtensions.cs new file mode 100644 index 0000000000000..87082c71eb68e --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/PublicIPPrefixesOperationsExtensions.cs @@ -0,0 +1,459 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 PublicIPPrefixesOperations. + /// + public static partial class PublicIPPrefixesOperationsExtensions + { + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + public static void Delete(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName) + { + operations.DeleteAsync(resourceGroupName, publicIpPrefixName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIPPrefx. + /// + /// + /// Expands referenced resources. + /// + public static PublicIPPrefix Get(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, string expand = default(string)) + { + return operations.GetAsync(resourceGroupName, publicIpPrefixName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIPPrefx. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix operation. + /// + public static PublicIPPrefix CreateOrUpdate(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates public IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix tags. + /// + public static PublicIPPrefix UpdateTags(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters) + { + return operations.UpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates public IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTagsAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListAll(this IPublicIPPrefixesOperations operations) + { + return operations.ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAllAsync(this IPublicIPPrefixesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage List(this IPublicIPPrefixesOperations operations, string resourceGroupName) + { + return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + public static void BeginDelete(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName) + { + operations.BeginDeleteAsync(resourceGroupName, publicIpPrefixName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the PublicIpPrefix. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix operation. + /// + public static PublicIPPrefix BeginCreateOrUpdate(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a static or dynamic public IP prefix. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to the create or update public IP prefix operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates public IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix tags. + /// + public static PublicIPPrefix BeginUpdateTags(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters) + { + return operations.BeginUpdateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates public IP prefix tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the public IP prefix. + /// + /// + /// Parameters supplied to update public IP prefix tags. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateTagsAsync(this IPublicIPPrefixesOperations operations, string resourceGroupName, string publicIpPrefixName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpPrefixName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the public IP prefixes in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAllNext(this IPublicIPPrefixesOperations operations, string nextPageLink) + { + return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the public IP prefixes 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> ListAllNextAsync(this IPublicIPPrefixesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all public IP prefixes in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPublicIPPrefixesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all public IP prefixes 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> ListNextAsync(this IPublicIPPrefixesOperations 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/PublicIpAddressesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs index 534a4e96730b9..deb4229e7d3d8 100644 --- a/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs @@ -119,7 +119,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1381,7 +1381,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1564,7 +1564,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1790,7 +1790,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs index b66ba8e2b5f3f..24715525532b9 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs @@ -126,7 +126,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -378,7 +378,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -576,7 +576,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -772,7 +772,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1007,7 +1007,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs index 80a4d191d6fcb..02a510264c9e2 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs @@ -119,7 +119,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +726,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs index 771e06c67153c..1670daaac045e 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs @@ -119,7 +119,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +726,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs index 553c13af8badc..4ef903ee2c7af 100644 --- a/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs @@ -126,7 +126,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs index 70c5b41d05974..94d88d9b029d1 100644 --- a/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs @@ -1,4 +1,3 @@ - // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is @@ -21,58 +20,72 @@ public static IEnumerable> ApiInfo_NetworkManageme { new Tuple("Compute", "NetworkInterfaces", "2017-03-30"), new Tuple("Compute", "PublicIPAddresses", "2017-03-30"), - new Tuple("Network", "ApplicationGateways", "2018-06-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2018-06-01"), - new Tuple("Network", "AvailableEndpointServices", "2018-06-01"), - new Tuple("Network", "AzureFirewalls", "2018-06-01"), - new Tuple("Network", "BgpServiceCommunities", "2018-06-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2018-06-01"), - new Tuple("Network", "ConnectionMonitors", "2018-06-01"), - new Tuple("Network", "DdosProtectionPlans", "2018-06-01"), - new Tuple("Network", "DefaultSecurityRules", "2018-06-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2018-06-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2018-06-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2018-06-01"), - new Tuple("Network", "ExpressRouteCircuits", "2018-06-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2018-06-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2018-06-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2018-06-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2018-06-01"), - new Tuple("Network", "InboundNatRules", "2018-06-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2018-06-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2018-06-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2018-06-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2018-06-01"), - new Tuple("Network", "LoadBalancerProbes", "2018-06-01"), - new Tuple("Network", "LoadBalancers", "2018-06-01"), - new Tuple("Network", "LocalNetworkGateways", "2018-06-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2018-06-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2018-06-01"), - new Tuple("Network", "NetworkInterfaces", "2018-06-01"), - new Tuple("Network", "NetworkSecurityGroups", "2018-06-01"), - new Tuple("Network", "NetworkWatchers", "2018-06-01"), - new Tuple("Network", "Operations", "2018-06-01"), - new Tuple("Network", "PacketCaptures", "2018-06-01"), - new Tuple("Network", "PublicIPAddresses", "2018-06-01"), - new Tuple("Network", "RouteFilterRules", "2018-06-01"), - new Tuple("Network", "RouteFilters", "2018-06-01"), - new Tuple("Network", "RouteTables", "2018-06-01"), - new Tuple("Network", "Routes", "2018-06-01"), - new Tuple("Network", "SecurityRules", "2018-06-01"), - new Tuple("Network", "Subnets", "2018-06-01"), - new Tuple("Network", "Usages", "2018-06-01"), - new Tuple("Network", "VirtualHubs", "2018-06-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2018-06-01"), - new Tuple("Network", "VirtualNetworkGateways", "2018-06-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2018-06-01"), - new Tuple("Network", "VirtualNetworks", "2018-06-01"), - new Tuple("Network", "VirtualWANs", "2018-06-01"), - new Tuple("Network", "VpnConnections", "2018-06-01"), - new Tuple("Network", "VpnGateways", "2018-06-01"), - new Tuple("Network", "VpnSites", "2018-06-01"), - new Tuple("Network", "VpnSitesConfiguration", "2018-06-01"), + new Tuple("Network", "ApplicationGateways", "2018-07-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2018-07-01"), + new Tuple("Network", "AvailableEndpointServices", "2018-07-01"), + new Tuple("Network", "AzureFirewalls", "2018-07-01"), + new Tuple("Network", "BgpServiceCommunities", "2018-07-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2018-07-01"), + new Tuple("Network", "ConnectionMonitors", "2018-07-01"), + new Tuple("Network", "DdosProtectionPlans", "2018-07-01"), + new Tuple("Network", "DefaultSecurityRules", "2018-07-01"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2018-07-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2018-07-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2018-07-01"), + new Tuple("Network", "ExpressRouteCircuits", "2018-07-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2018-07-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2018-07-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2018-07-01"), + new Tuple("Network", "HubVirtualNetworkConnections", "2018-07-01"), + new Tuple("Network", "InboundNatRules", "2018-07-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2018-07-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2018-07-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2018-07-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2018-07-01"), + new Tuple("Network", "LoadBalancerProbes", "2018-07-01"), + new Tuple("Network", "LoadBalancers", "2018-07-01"), + new Tuple("Network", "LocalNetworkGateways", "2018-07-01"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2018-07-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2018-07-01"), + new Tuple("Network", "NetworkInterfaces", "2018-07-01"), + new Tuple("Network", "NetworkSecurityGroups", "2018-07-01"), + new Tuple("Network", "NetworkWatchers", "2018-07-01"), + new Tuple("Network", "Operations", "2018-07-01"), + new Tuple("Network", "PacketCaptures", "2018-07-01"), + new Tuple("Network", "PublicIPAddresses", "2018-07-01"), + new Tuple("Network", "PublicIPPrefixes", "2018-07-01"), + new Tuple("Network", "RouteFilterRules", "2018-07-01"), + new Tuple("Network", "RouteFilters", "2018-07-01"), + new Tuple("Network", "RouteTables", "2018-07-01"), + new Tuple("Network", "Routes", "2018-07-01"), + new Tuple("Network", "SecurityRules", "2018-07-01"), + new Tuple("Network", "ServiceEndpointPolicies", "2018-07-01"), + new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2018-07-01"), + new Tuple("Network", "Subnets", "2018-07-01"), + new Tuple("Network", "Usages", "2018-07-01"), + new Tuple("Network", "VirtualHubs", "2018-07-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2018-07-01"), + new Tuple("Network", "VirtualNetworkGateways", "2018-07-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2018-07-01"), + new Tuple("Network", "VirtualNetworks", "2018-07-01"), + new Tuple("Network", "VirtualWANs", "2018-07-01"), + new Tuple("Network", "VpnConnections", "2018-07-01"), + new Tuple("Network", "VpnGateways", "2018-07-01"), + new Tuple("Network", "VpnSites", "2018-07-01"), + new Tuple("Network", "VpnSitesConfiguration", "2018-07-01"), + new Tuple("Network", "serviceEndpointPolicies", "2018-07-01"), }.AsEnumerable(); } } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "latest"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Work\\azure-sdk-for-net\\src\\SDKs"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "7af01aa799cf34b4c2d736401a08eb1fd7f02064"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section } } diff --git a/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs index 0b0f3ceea2475..c6360ac821c4e 100644 --- a/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs @@ -126,7 +126,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPoliciesOperations.cs b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPoliciesOperations.cs new file mode 100644 index 0000000000000..90b52c8fb67d9 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPoliciesOperations.cs @@ -0,0 +1,1644 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ServiceEndpointPoliciesOperations operations. + /// + internal partial class ServiceEndpointPoliciesOperations : IServiceOperations, IServiceEndpointPoliciesOperations + { + /// + /// Initializes a new instance of the ServiceEndpointPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServiceEndpointPoliciesOperations(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 service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Expands referenced resources. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); + 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/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + 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 service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all service endpoint Policies in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// 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 serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// 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 serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates service Endpoint Policies. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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/serviceEndpointPolicies/{serviceEndpointPolicyName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(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; + } + + /// + /// Gets all the service endpoint policies 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 service endpoint Policies 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/ServiceEndpointPoliciesOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPoliciesOperationsExtensions.cs new file mode 100644 index 0000000000000..16dd0b0595a9d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPoliciesOperationsExtensions.cs @@ -0,0 +1,463 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 ServiceEndpointPoliciesOperations. + /// + public static partial class ServiceEndpointPoliciesOperationsExtensions + { + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static void Delete(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + { + operations.DeleteAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Expands referenced resources. + /// + public static ServiceEndpointPolicy Get(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string)) + { + return operations.GetAsync(resourceGroupName, serviceEndpointPolicyName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + public static ServiceEndpointPolicy CreateOrUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy tags. + /// + public static ServiceEndpointPolicy Update(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters) + { + return operations.UpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IServiceEndpointPoliciesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all the service endpoint policies in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IServiceEndpointPoliciesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all service endpoint Policies in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IServiceEndpointPoliciesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all service endpoint Policies 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 IServiceEndpointPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + public static void BeginDelete(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + { + operations.BeginDeleteAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + public static ServiceEndpointPolicy BeginCreateOrUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy tags. + /// + public static ServiceEndpointPolicy BeginUpdate(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates service Endpoint Policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// Parameters supplied to update service endpoint policy tags. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the service endpoint policies 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 IServiceEndpointPoliciesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the service endpoint policies 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 IServiceEndpointPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all service endpoint Policies 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 IServiceEndpointPoliciesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all service endpoint Policies 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 IServiceEndpointPoliciesOperations 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/ServiceEndpointPolicyDefinitionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPolicyDefinitionsOperations.cs new file mode 100644 index 0000000000000..8584c31740cfb --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPolicyDefinitionsOperations.cs @@ -0,0 +1,1099 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ServiceEndpointPolicyDefinitionsOperations operations. + /// + internal partial class ServiceEndpointPolicyDefinitionsOperations : IServiceOperations, IServiceEndpointPolicyDefinitionsOperations + { + /// + /// Initializes a new instance of the ServiceEndpointPolicyDefinitionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServiceEndpointPolicyDefinitionsOperations(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 ServiceEndpoint policy definitions. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (serviceEndpointPolicyDefinitionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("serviceEndpointPolicyDefinitionName", serviceEndpointPolicyDefinitionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{serviceEndpointPolicyDefinitionName}", System.Uri.EscapeDataString(serviceEndpointPolicyDefinitionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// 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 serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (serviceEndpointPolicyDefinitionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("serviceEndpointPolicyDefinitionName", serviceEndpointPolicyDefinitionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{serviceEndpointPolicyDefinitionName}", System.Uri.EscapeDataString(serviceEndpointPolicyDefinitionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// 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 serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceEndpointPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyName"); + } + if (serviceEndpointPolicyDefinitionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitionName"); + } + if (serviceEndpointPolicyDefinitions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceEndpointPolicyDefinitions"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-07-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceEndpointPolicyName", serviceEndpointPolicyName); + tracingParameters.Add("serviceEndpointPolicyDefinitionName", serviceEndpointPolicyDefinitionName); + tracingParameters.Add("serviceEndpointPolicyDefinitions", serviceEndpointPolicyDefinitions); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); + _url = _url.Replace("{serviceEndpointPolicyDefinitionName}", System.Uri.EscapeDataString(serviceEndpointPolicyDefinitionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(serviceEndpointPolicyDefinitions != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(serviceEndpointPolicyDefinitions, 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 service endpoint policy definitions in a service end point policy. + /// + /// + /// 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/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs new file mode 100644 index 0000000000000..dc2f803a5d65b --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ServiceEndpointPolicyDefinitionsOperationsExtensions.cs @@ -0,0 +1,345 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 ServiceEndpointPolicyDefinitionsOperations. + /// + public static partial class ServiceEndpointPolicyDefinitionsOperationsExtensions + { + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + public static void Delete(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + { + operations.DeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The name of the service endpoint policy definition name. + /// + public static ServiceEndpointPolicyDefinition Get(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + { + return operations.GetAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + } + + /// + /// Get the specified service endpoint policy definitions from service endpoint + /// policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + public static ServiceEndpointPolicyDefinition CreateOrUpdate(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + public static IPage ListByResourceGroup(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName) + { + return operations.ListByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName).GetAwaiter().GetResult(); + } + + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + public static void BeginDelete(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName) + { + operations.BeginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified ServiceEndpoint policy definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Service Endpoint Policy. + /// + /// + /// The name of the service endpoint policy definition. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + public static ServiceEndpointPolicyDefinition BeginCreateOrUpdate(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a service endpoint policy definition in the specified + /// service endpoint policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the service endpoint policy. + /// + /// + /// The name of the service endpoint policy definition name. + /// + /// + /// Parameters supplied to the create or update service endpoint policy + /// operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IServiceEndpointPolicyDefinitionsOperations operations, string resourceGroupName, string serviceEndpointPolicyName, string serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinition serviceEndpointPolicyDefinitions, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IServiceEndpointPolicyDefinitionsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all service endpoint policy definitions in a service end point policy. + /// + /// + /// 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 IServiceEndpointPolicyDefinitionsOperations 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/SubnetsOperations.cs b/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs index accee6066558b..e8475ce22e28a 100644 --- a/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs @@ -129,7 +129,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -358,7 +358,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -748,7 +748,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs b/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs index a513e2ea3e37b..f42469861159a 100644 --- a/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs @@ -85,16 +85,16 @@ internal UsagesOperations(NetworkManagementClient client) } if (location != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(location, "^[-\\w\\._ ]+$")) { - throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._ ]+$"); } } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualHubsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualHubsOperations.cs index 4691d0d917836..85892358cd5ca 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualHubsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualHubsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -349,7 +349,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -522,7 +522,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -936,7 +936,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1147,7 +1147,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs index 3ee4bf02af4f2..33f2df0d98017 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -121,7 +121,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -393,7 +393,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -581,7 +581,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -815,7 +815,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1031,7 +1031,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1214,7 +1214,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1430,7 +1430,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1664,7 +1664,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index 4c4cc33de167a..e6cb2051d223c 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -120,7 +120,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -870,7 +870,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1173,7 +1173,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1382,7 +1382,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1598,7 +1598,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1781,7 +1781,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1987,7 +1987,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2195,7 +2195,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2405,7 +2405,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2608,7 +2608,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2805,7 +2805,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3005,7 +3005,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3207,7 +3207,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3420,7 +3420,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3623,7 +3623,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs index 8e0733588acac..79ee94355f704 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +742,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs index bf26eeed431ef..a32a89cefe8ec 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs @@ -119,7 +119,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -732,7 +732,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -931,7 +931,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1122,7 +1122,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1305,7 +1305,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1531,7 +1531,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualWANsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualWANsOperations.cs index 8d7e128f37685..6be2632b20c30 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualWANsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualWANsOperations.cs @@ -94,7 +94,7 @@ internal VirtualWANsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -349,7 +349,7 @@ internal VirtualWANsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -522,7 +522,7 @@ internal VirtualWANsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualWANsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -936,7 +936,7 @@ internal VirtualWANsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1147,7 +1147,7 @@ internal VirtualWANsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VpnConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VpnConnectionsOperations.cs index ed4069e244564..73203071cdeeb 100644 --- a/src/SDKs/Network/Management.Network/Generated/VpnConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VpnConnectionsOperations.cs @@ -101,7 +101,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -770,7 +770,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VpnGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/VpnGatewaysOperations.cs index a46f562e51b49..dd349bda89147 100644 --- a/src/SDKs/Network/Management.Network/Generated/VpnGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -349,7 +349,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -522,7 +522,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -936,7 +936,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1147,7 +1147,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VpnSitesConfigurationOperations.cs b/src/SDKs/Network/Management.Network/Generated/VpnSitesConfigurationOperations.cs index db5383f6e451b..32bb5f597aff0 100644 --- a/src/SDKs/Network/Management.Network/Generated/VpnSitesConfigurationOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VpnSitesConfigurationOperations.cs @@ -127,7 +127,7 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VpnSitesOperations.cs b/src/SDKs/Network/Management.Network/Generated/VpnSitesOperations.cs index 5647ecbd55b64..fa706a7b3660f 100644 --- a/src/SDKs/Network/Management.Network/Generated/VpnSitesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VpnSitesOperations.cs @@ -94,7 +94,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -349,7 +349,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -522,7 +522,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -936,7 +936,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1147,7 +1147,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2018-06-01"; + string apiVersion = "2018-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj b/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj index 7a024b4614436..71860a734bc4a 100644 --- a/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj +++ b/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj @@ -7,11 +7,15 @@ Microsoft.Azure.Management.Network Provides management capabilities for Network services. Microsoft.Azure.Management.Network - 19.2.0-preview + 19.3.0-preview Microsoft Azure Network management;Network;Network management; diff --git a/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs b/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs index e7098e2bbc615..5306dd482df0a 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("19.0.2.0")] -[assembly: AssemblyFileVersion("19.2.0.0")] +[assembly: AssemblyFileVersion("19.3.0.0")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/src/SDKs/Network/Network.Tests/Tests/LoadBalancerTests.cs b/src/SDKs/Network/Network.Tests/Tests/LoadBalancerTests.cs index c26b018821f58..22a14a264dfc0 100644 --- a/src/SDKs/Network/Network.Tests/Tests/LoadBalancerTests.cs +++ b/src/SDKs/Network/Network.Tests/Tests/LoadBalancerTests.cs @@ -1435,141 +1435,5 @@ public void LoadBalancerNatPoolTest() networkManagementClient.PublicIPAddresses.Delete(resourceGroupName, lbPublicIpName); } } - - [Fact(Skip="Disable tests")] - public void LoadBalancerOutboundNatRuleTest() - { - var handler1 = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; - var handler2 = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; - - using (var context = MockContext.Start(this.GetType().FullName)) - { - var resourcesClient = ResourcesManagementTestUtilities.GetResourceManagementClientWithHandler(context, handler1); - var networkManagementClient = NetworkManagementTestUtilities.GetNetworkManagementClientWithHandler(context, handler2); - - var location = NetworkManagementTestUtilities.GetResourceLocation(resourcesClient, "Microsoft.Network/loadBalancers"); - - string resourceGroupName = TestUtilities.GenerateName("csmrg"); - resourcesClient.ResourceGroups.CreateOrUpdate( - resourceGroupName, - new ResourceGroup { Location = location }); - - // Create lbPublicIP - string lbPublicIpName = TestUtilities.GenerateName(); - string lbDomaingNameLabel = TestUtilities.GenerateName(); - - var lbPublicIp = TestHelper.CreateDefaultPublicIpAddress( - lbPublicIpName, - resourceGroupName, - lbDomaingNameLabel, - location, - networkManagementClient); - - // Create the LoadBalancer - var lbName = TestUtilities.GenerateName(); - var frontendIpConfigName = TestUtilities.GenerateName(); - var outboundNatPool1Name = TestUtilities.GenerateName(); - var backendaddresspoolName = TestUtilities.GenerateName(); - var inboundNatRule1Name = TestUtilities.GenerateName(); - - var loadBalancer = new LoadBalancer() - { - Location = location, - FrontendIPConfigurations = new List() - { - new FrontendIPConfiguration() - { - Name = frontendIpConfigName, - PublicIPAddress = new PublicIPAddress () - { - Id = lbPublicIp.Id - } - } - }, - BackendAddressPools = new List() - { - new BackendAddressPool() - { - Name = backendaddresspoolName - } - }, - OutboundNatRules = new List() - { - new OutboundNatRule() - { - Name = outboundNatPool1Name, - AllocatedOutboundPorts = 1000, - BackendAddressPool = new SubResource() - { - Id = TestHelper.GetChildLbResourceId(networkManagementClient.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backendaddresspoolName) - }, - FrontendIPConfigurations = new List() - { - new SubResource() - { - Id = TestHelper.GetChildLbResourceId(networkManagementClient.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - } - } - }, - InboundNatRules = new List() - { - new InboundNatRule() - { - Name = inboundNatRule1Name, - FrontendIPConfiguration = new SubResource() - { - Id = TestHelper.GetChildLbResourceId(networkManagementClient.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName) - }, - Protocol = TransportProtocol.Tcp, - FrontendPort = 3389, - BackendPort = 3389, - IdleTimeoutInMinutes = 15, - EnableFloatingIP = false - }, - } - }; - - // Create the loadBalancer - var putLoadBalancer = networkManagementClient.LoadBalancers.CreateOrUpdate( - resourceGroupName, - lbName, - loadBalancer); - - var getLoadBalancer = networkManagementClient.LoadBalancers.Get(resourceGroupName, lbName); - - // Verify the GET LoadBalancer - Assert.Equal(lbName, getLoadBalancer.Name); - Assert.Equal("Succeeded", getLoadBalancer.ProvisioningState); - Assert.Equal(frontendIpConfigName, getLoadBalancer.FrontendIPConfigurations[0].Name); - Assert.Equal("Succeeded", getLoadBalancer.FrontendIPConfigurations[0].ProvisioningState); - - // Verify the nat pool - Assert.Equal(1, getLoadBalancer.OutboundNatRules.Count); - Assert.Equal(outboundNatPool1Name, getLoadBalancer.OutboundNatRules[0].Name); - Assert.Equal(1000, getLoadBalancer.OutboundNatRules[0].AllocatedOutboundPorts); - Assert.Equal(TestHelper.GetChildLbResourceId(networkManagementClient.SubscriptionId, - resourceGroupName, lbName, "backendAddressPools", backendaddresspoolName), getLoadBalancer.OutboundNatRules[0].BackendAddressPool.Id); - Assert.Equal(1, getLoadBalancer.OutboundNatRules[0].FrontendIPConfigurations.Count); - Assert.Equal(TestHelper.GetChildLbResourceId(networkManagementClient.SubscriptionId, - resourceGroupName, lbName, "frontendIPConfigurations", frontendIpConfigName), getLoadBalancer.OutboundNatRules[0].FrontendIPConfigurations[0].Id); - - Assert.Equal(getLoadBalancer.OutboundNatRules[0].Id, getLoadBalancer.FrontendIPConfigurations[0].OutboundNatRules[0].Id); - Assert.Equal(getLoadBalancer.OutboundNatRules[0].Id, getLoadBalancer.BackendAddressPools[0].OutboundNatRule.Id); - - // Delete LoadBalancer - networkManagementClient.LoadBalancers.Delete(resourceGroupName, lbName); - - // Verify Delete - var listLoadBalancer = networkManagementClient.LoadBalancers.List(resourceGroupName); - Assert.Equal(0, listLoadBalancer.Count()); - - // Delete all PublicIPAddresses - networkManagementClient.PublicIPAddresses.Delete(resourceGroupName, lbPublicIpName); - } - } } } diff --git a/src/SDKs/_metadata/network_resource-manager.txt b/src/SDKs/_metadata/network_resource-manager.txt index ebb7a37e077fb..e02abfc9b0e17 100644 --- a/src/SDKs/_metadata/network_resource-manager.txt +++ b/src/SDKs/_metadata/network_resource-manager.txt @@ -1,20 +1 @@ -Installing AutoRest version: latest -AutoRest installed successfully. -Commencing code generation -Generating CSharp code -Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\Projects\azure-sdk-for-net\src\SDKs -2018-07-26 06:54:23 UTC -1) azure-rest-api-specs repository information -GitHub fork: Azure -Branch: master -Commit: 2ba52c8f8b8dd6ca2a5f2a84d5bb8aaf51ce3497 - -2) AutoRest information -Requested version: latest -Bootstrapper version: autorest@2.0.4282 - - -Latest installed version: - - +