diff --git a/eng/mgmt/mgmtmetadata/network_resource-manager.txt b/eng/mgmt/mgmtmetadata/network_resource-manager.txt index 42737c798883..247f156103cf 100644 --- a/eng/mgmt/mgmtmetadata/network_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/network_resource-manager.txt @@ -4,11 +4,11 @@ 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\sdk -2019-10-02 23:14:50 UTC +2019-10-22 02:09:10 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: be57615271c318b48a5d9a619878a18697378277 +Commit: 6405fdd6023e04e54fb5c834c6f658ee10d59ca4 AutoRest information Requested version: latest Bootstrapper version: autorest@2.0.4283 diff --git a/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props b/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props index c878826afbec..ce3027020531 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props +++ b/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props @@ -1,7 +1,7 @@ - Compute_2018-10-01;Network_2019-08-01;Network_2019-06-01; + Compute_2018-10-01;Network_2019-09-01;Network_2019-06-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs index df535c939ff7..543853a810c9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs @@ -116,7 +116,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -304,16 +304,199 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update application gateway tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (applicationGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("applicationGatewayName", applicationGatewayName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (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 - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + 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; } /// @@ -353,7 +536,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +714,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -808,7 +991,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -979,7 +1162,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1150,7 +1333,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1321,7 +1504,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1497,7 +1680,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1673,7 +1856,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1856,7 +2039,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2045,7 +2228,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2232,7 +2415,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2407,214 +2590,6 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) return _result; } - /// - /// Updates the specified application gateway tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to update application gateway 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 applicationGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (applicationGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2019-08-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("applicationGatewayName", applicationGatewayName); - 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/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (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; - } - /// /// Starts the specified application gateway. /// @@ -2656,7 +2631,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2829,7 +2804,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3010,7 +2985,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3221,7 +3196,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "probeRequest"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperationsExtensions.cs index f602030cb8e5..87b3f5be5724 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperationsExtensions.cs @@ -719,52 +719,6 @@ public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOp } } - /// - /// Updates the specified application gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to update application gateway tags. - /// - public static ApplicationGateway BeginUpdateTags(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, applicationGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates the specified application gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to update application gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Starts the specified application gateway. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs index a9ab9625a42e..a63868b64b92 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs @@ -116,7 +116,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -305,22 +305,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// Parameters supplied to update application security group tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all application security groups in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -341,13 +325,25 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (applicationSecurityGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -355,13 +351,18 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -375,7 +376,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -406,6 +407,12 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) // 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) { @@ -461,7 +468,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -474,7 +481,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -494,11 +501,8 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Gets all the application security groups in a resource group. + /// Gets all application security groups in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -520,17 +524,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -538,15 +538,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -679,14 +677,11 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Deletes the specified application security group. + /// Gets all the application security groups in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the application security group. - /// /// /// Headers that will be added to request. /// @@ -696,6 +691,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -705,21 +703,17 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (applicationSecurityGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -728,16 +722,14 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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/applicationSecurityGroups/{applicationSecurityGroupName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationSecurityGroupName}", System.Uri.EscapeDataString(applicationSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -751,7 +743,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -802,7 +794,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -837,13 +829,31 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -852,7 +862,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Creates or updates an application security group. + /// Deletes the specified application security group. /// /// /// The name of the resource group. @@ -860,10 +870,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// The name of the application security group. /// - /// - /// Parameters supplied to the create or update ApplicationSecurityGroup - /// operation. - /// /// /// Headers that will be added to request. /// @@ -873,9 +879,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -885,7 +888,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -895,15 +898,11 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationSecurityGroupName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,10 +912,9 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationSecurityGroupName", applicationSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -936,7 +934,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -967,12 +965,6 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) // 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) { @@ -993,7 +985,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1028,49 +1020,13 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1079,7 +1035,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Updates an application security group's tags. + /// Creates or updates an application security group. /// /// /// The name of the resource group. @@ -1088,7 +1044,8 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// The name of the application security group. /// /// - /// Parameters supplied to update application security group tags. + /// Parameters supplied to the create or update ApplicationSecurityGroup + /// operation. /// /// /// Headers that will be added to request. @@ -1111,7 +1068,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1129,7 +1086,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1142,7 +1099,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1162,7 +1119,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1219,7 +1176,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1279,6 +1236,24 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperationsExtensions.cs index d2c8aeebf3d4..0cf4d8d745eb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperationsExtensions.cs @@ -339,52 +339,6 @@ public static ApplicationSecurityGroup BeginCreateOrUpdate(this IApplicationSecu } } - /// - /// Updates an application security group's tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to update application security group tags. - /// - public static ApplicationSecurityGroup BeginUpdateTags(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates an application security group's tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to update application security group tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IApplicationSecurityGroupsOperations operations, string resourceGroupName, string applicationSecurityGroupName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, applicationSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all application security groups in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs index 26ac9f9bab13..27896e5db370 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs @@ -88,7 +88,7 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs index e1674eb1e47d..6a732bb8f7a7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs @@ -87,7 +87,7 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs index faa4a8c893e9..462a1337d618 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs @@ -88,7 +88,7 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -281,7 +281,7 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs index 2862b70020ac..9944ff4f692d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs @@ -95,7 +95,7 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs index 9f2febcef06f..7701d0003946 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs @@ -87,7 +87,7 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -279,7 +279,7 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs index 11ca89606213..2557326a93cb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs @@ -80,7 +80,7 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs index 6a519f736fd7..5b10eafd31bf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs @@ -116,7 +116,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -292,7 +292,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) } /// - /// Updates tags for an Azure Firewall resource. + /// Updates tags of an Azure Firewall resource. /// /// /// The name of the resource group. @@ -301,7 +301,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// The name of the Azure Firewall. /// /// - /// Parameters supplied to the create or update Azure Firewall operation. + /// Parameters supplied to update azure firewall tags. /// /// /// Headers that will be added to request. @@ -324,7 +324,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -342,7 +342,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1084,7 +1084,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs index 818f7fed4ff8..351842794e99 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs @@ -145,7 +145,7 @@ public static AzureFirewall CreateOrUpdate(this IAzureFirewallsOperations operat } /// - /// Updates tags for an Azure Firewall resource. + /// Updates tags of an Azure Firewall resource. /// /// /// The operations group for this extension method. @@ -157,15 +157,15 @@ public static AzureFirewall CreateOrUpdate(this IAzureFirewallsOperations operat /// The name of the Azure Firewall. /// /// - /// Parameters supplied to the create or update Azure Firewall operation. + /// Parameters supplied to update azure firewall tags. /// - public static AzureFirewall UpdateTags(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters) + public static AzureFirewall UpdateTags(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters) { return operations.UpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).GetAwaiter().GetResult(); } /// - /// Updates tags for an Azure Firewall resource. + /// Updates tags of an Azure Firewall resource. /// /// /// The operations group for this extension method. @@ -177,12 +177,12 @@ public static AzureFirewall UpdateTags(this IAzureFirewallsOperations operations /// The name of the Azure Firewall. /// /// - /// Parameters supplied to the create or update Azure Firewall operation. + /// Parameters supplied to update azure firewall tags. /// /// /// The cancellation token. /// - public static async Task UpdateTagsAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, AzureFirewall parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateTagsAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, azureFirewallName, parameters, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs index c2186b861db4..998866f38e22 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs @@ -116,7 +116,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,7 +693,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -876,7 +876,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs index d1ecc7be5c4d..1c227057bc3d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs @@ -80,7 +80,7 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs index 13a343e6ab94..c9f24d72ba2e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs @@ -116,7 +116,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -301,29 +301,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// The name of the DDoS custom policy. /// /// - /// Parameters supplied to the update DDoS custom policy resource tags. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the specified DDoS custom policy. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. + /// Parameters supplied to update DDoS custom policy resource tags. /// /// /// Headers that will be added to request. @@ -334,6 +312,9 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -343,7 +324,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -353,11 +334,15 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ddosCustomPolicyName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -367,9 +352,10 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosCustomPolicyName", ddosCustomPolicyName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -389,7 +375,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -420,6 +406,12 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) // 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) { @@ -440,7 +432,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -475,13 +467,31 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -490,7 +500,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) } /// - /// Creates or updates a DDoS custom policy. + /// Deletes the specified DDoS custom policy. /// /// /// The name of the resource group. @@ -498,9 +508,6 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// The name of the DDoS custom policy. /// - /// - /// Parameters supplied to the create or update operation. - /// /// /// Headers that will be added to request. /// @@ -510,9 +517,6 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -522,7 +526,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -532,15 +536,11 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ddosCustomPolicyName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,10 +550,9 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosCustomPolicyName", ddosCustomPolicyName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -573,7 +572,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -604,12 +603,6 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) // 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) { @@ -630,7 +623,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -665,49 +658,13 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -716,7 +673,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) } /// - /// Update a DDoS custom policy tags. + /// Creates or updates a DDoS custom policy. /// /// /// The name of the resource group. @@ -725,7 +682,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// The name of the DDoS custom policy. /// /// - /// Parameters supplied to the update DDoS custom policy resource tags. + /// Parameters supplied to the create or update operation. /// /// /// Headers that will be added to request. @@ -748,7 +705,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -766,7 +723,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -779,7 +736,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -799,7 +756,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -856,7 +813,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -916,6 +873,24 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperationsExtensions.cs index a356e8c2fc3a..0ecaf5913919 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperationsExtensions.cs @@ -157,7 +157,7 @@ public static DdosCustomPolicy CreateOrUpdate(this IDdosCustomPoliciesOperations /// The name of the DDoS custom policy. /// /// - /// Parameters supplied to the update DDoS custom policy resource tags. + /// Parameters supplied to update DDoS custom policy resource tags. /// public static DdosCustomPolicy UpdateTags(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters) { @@ -177,7 +177,7 @@ public static DdosCustomPolicy UpdateTags(this IDdosCustomPoliciesOperations ope /// The name of the DDoS custom policy. /// /// - /// Parameters supplied to the update DDoS custom policy resource tags. + /// Parameters supplied to update DDoS custom policy resource tags. /// /// /// The cancellation token. @@ -273,51 +273,5 @@ public static DdosCustomPolicy BeginCreateOrUpdate(this IDdosCustomPoliciesOpera } } - /// - /// Update a DDoS custom policy tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the update DDoS custom policy resource tags. - /// - public static DdosCustomPolicy BeginUpdateTags(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update a DDoS custom policy tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the update DDoS custom policy resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IDdosCustomPoliciesOperations operations, string resourceGroupName, string ddosCustomPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosCustomPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs index 551bf1a52477..27ae321fb8da 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs @@ -116,7 +116,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -304,22 +304,6 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// Parameters supplied to the update DDoS protection plan resource tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all DDoS protection plans in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -340,13 +324,25 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,13 +350,18 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -374,7 +375,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -405,6 +406,12 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) // 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) { @@ -460,7 +467,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -473,7 +480,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -493,11 +500,8 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) } /// - /// Gets all the DDoS protection plans in a resource group. + /// Gets all DDoS protection plans in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -519,17 +523,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,15 +537,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + 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/ddosProtectionPlans").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -678,14 +676,11 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) } /// - /// Deletes the specified DDoS protection plan. + /// Gets all the DDoS protection plans in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the DDoS protection plan. - /// /// /// Headers that will be added to request. /// @@ -695,6 +690,9 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -704,21 +702,17 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (ddosProtectionPlanName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -727,16 +721,14 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -750,7 +742,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -801,7 +793,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -836,13 +828,31 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -851,7 +861,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) } /// - /// Creates or updates a DDoS protection plan. + /// Deletes the specified DDoS protection plan. /// /// /// The name of the resource group. @@ -859,9 +869,6 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// The name of the DDoS protection plan. /// - /// - /// Parameters supplied to the create or update operation. - /// /// /// Headers that will be added to request. /// @@ -871,9 +878,6 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -883,7 +887,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -893,15 +897,11 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,10 +911,9 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -934,7 +933,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -965,12 +964,6 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) // 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) { @@ -991,7 +984,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1026,49 +1019,13 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1077,7 +1034,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) } /// - /// Update a DDoS protection plan tags. + /// Creates or updates a DDoS protection plan. /// /// /// The name of the resource group. @@ -1086,7 +1043,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// The name of the DDoS protection plan. /// /// - /// Parameters supplied to the update DDoS protection plan resource tags. + /// Parameters supplied to the create or update operation. /// /// /// Headers that will be added to request. @@ -1109,7 +1066,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1127,7 +1084,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1140,7 +1097,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1160,7 +1117,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1217,7 +1174,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1277,6 +1234,24 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperationsExtensions.cs index 04082b1155ec..399ab87a9721 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperationsExtensions.cs @@ -335,52 +335,6 @@ public static DdosProtectionPlan BeginCreateOrUpdate(this IDdosProtectionPlansOp } } - /// - /// Update a DDoS protection plan tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the update DDoS protection plan resource tags. - /// - public static DdosProtectionPlan BeginUpdateTags(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update a DDoS protection plan tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the update DDoS protection plan resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all DDoS protection plans in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs index ff3b2b454c14..d76e2cbacc1f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs @@ -94,7 +94,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index f46097246ab7..d2c64923ec39 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -127,7 +127,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs index 4e6fc4d0f9ec..bd0c97a1117b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -138,7 +138,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -377,7 +377,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -585,7 +585,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -788,7 +788,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs index 55f648117fbe..c32473655e01 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -126,7 +126,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs index 385d62ee6a18..108334007401 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -305,16 +305,199 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// Parameters supplied to update express route circuit tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (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 - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + 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; } /// @@ -448,7 +631,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -649,7 +832,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -838,7 +1021,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1016,7 +1199,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1203,7 +1386,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1387,7 +1570,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1562,214 +1745,6 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) return _result; } - /// - /// Updates an express route circuit tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to update express route circuit 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 circuitName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (circuitName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("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/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (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 the currently advertised ARP table associated with the express route /// circuit in a resource group. @@ -1829,7 +1804,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2042,7 +2017,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2255,7 +2230,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperationsExtensions.cs index 3d263d2bfff8..712336d84c10 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperationsExtensions.cs @@ -587,52 +587,6 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits } } - /// - /// Updates an express route circuit tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to update express route circuit tags. - /// - public static ExpressRouteCircuit BeginUpdateTags(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, circuitName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates an express route circuit tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to update express route circuit tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets the currently advertised ARP table associated with the express route /// circuit in a resource group. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs index 9ec4f35fca84..1e3a5556d77f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs @@ -130,7 +130,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -564,7 +564,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -789,7 +789,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs index cbf228cf2346..1b944300c223 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -94,7 +94,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs index fbc2a563c064..369f49375b04 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -643,118 +643,6 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// Parameters supplied to update express route cross connection tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the currently advertised ARP table associated with the express route - /// cross connection in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the route table summary associated with the express route cross - /// connection in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the currently advertised routes table associated with the express - /// route cross connection in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Update the specified ExpressRouteCrossConnection. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRouteCrossConnection. - /// - /// - /// Parameters supplied to the update express route crossConnection operation. - /// - /// /// Headers that will be added to request. /// /// @@ -775,7 +663,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -785,15 +673,15 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); } - if (parameters == null) + if (crossConnectionParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionParameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -803,10 +691,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("crossConnectionParameters", crossConnectionParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -826,7 +714,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -857,9 +745,9 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) + if(crossConnectionParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(crossConnectionParameters, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -951,16 +839,103 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) } /// - /// Updates an express route cross connection tags. + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the cross connection. + /// The name of the ExpressRouteCrossConnection. /// - /// - /// Parameters supplied to update express route cross connection tags. + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. /// /// /// Headers that will be added to request. @@ -983,7 +958,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -993,15 +968,15 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); } - if (crossConnectionParameters == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1011,10 +986,10 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("crossConnectionName", crossConnectionName); - tracingParameters.Add("crossConnectionParameters", crossConnectionParameters); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1034,7 +1009,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1065,9 +1040,9 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(crossConnectionParameters != null) + if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(crossConnectionParameters, Client.SerializationSettings); + _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"); } @@ -1217,7 +1192,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1430,7 +1405,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1643,7 +1618,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs index 8e51eda1ca54..d977722d61c4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs @@ -423,52 +423,6 @@ public static ExpressRouteCrossConnection BeginCreateOrUpdate(this IExpressRoute } } - /// - /// Updates an express route cross connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cross connection. - /// - /// - /// Parameters supplied to update express route cross connection tags. - /// - public static ExpressRouteCrossConnection BeginUpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates an express route cross connection tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cross connection. - /// - /// - /// Parameters supplied to update express route cross connection tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets the currently advertised ARP table associated with the express route /// cross connection in a resource group. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs index 8cdd189c13bc..3703ac2a895a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -480,7 +480,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -709,7 +709,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -927,7 +927,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs index a3edba5d50b4..eb8b1f2e652d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs @@ -101,7 +101,7 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -298,7 +298,7 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs index c22c09e6b651..3a003e2efb56 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs @@ -82,7 +82,7 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -266,7 +266,7 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs index 6917318c733f..b4112f721775 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -304,25 +304,6 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// Parameters supplied to update ExpressRoutePort resource tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List all the ExpressRoutePort resources in the specified resource group. - /// - /// - /// The name of the resource group. - /// - /// /// Headers that will be added to request. /// /// @@ -343,7 +324,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -353,7 +334,15 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (expressRoutePortName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,14 +352,17 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("expressRoutePortName", expressRoutePortName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/ExpressRoutePorts").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -383,7 +375,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -414,6 +406,12 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) // 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) { @@ -469,7 +467,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -482,7 +480,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -502,8 +500,11 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) } /// - /// List all the ExpressRoutePort resources in the specified subscription. + /// List all the ExpressRoutePort resources in the specified resource group. /// + /// + /// The name of the resource group. + /// /// /// Headers that will be added to request. /// @@ -525,13 +526,17 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,13 +545,15 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/ExpressRoutePorts").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -678,14 +685,8 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) } /// - /// Deletes the specified ExpressRoutePort resource. + /// List all the ExpressRoutePort resources in the specified subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// /// /// Headers that will be added to request. /// @@ -695,6 +696,9 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -704,21 +708,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (expressRoutePortName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -727,17 +723,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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/ExpressRoutePorts/{expressRoutePortName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{expressRoutePortName}", System.Uri.EscapeDataString(expressRoutePortName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -750,7 +742,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -801,7 +793,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -836,13 +828,31 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -851,7 +861,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) } /// - /// Creates or updates the specified ExpressRoutePort resource. + /// Deletes the specified ExpressRoutePort resource. /// /// /// The name of the resource group. @@ -859,9 +869,6 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// The name of the ExpressRoutePort resource. /// - /// - /// Parameters supplied to the create ExpressRoutePort operation. - /// /// /// Headers that will be added to request. /// @@ -871,9 +878,6 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -883,7 +887,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -897,11 +901,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -912,9 +912,8 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("expressRoutePortName", expressRoutePortName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -934,7 +933,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -965,12 +964,6 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) // 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) { @@ -991,7 +984,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1026,49 +1019,13 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1077,7 +1034,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) } /// - /// Update ExpressRoutePort tags. + /// Creates or updates the specified ExpressRoutePort resource. /// /// /// The name of the resource group. @@ -1086,7 +1043,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// The name of the ExpressRoutePort resource. /// /// - /// Parameters supplied to update ExpressRoutePort resource tags. + /// Parameters supplied to the create ExpressRoutePort operation. /// /// /// Headers that will be added to request. @@ -1109,7 +1066,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1127,7 +1084,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1140,7 +1097,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) tracingParameters.Add("expressRoutePortName", expressRoutePortName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1160,7 +1117,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1217,7 +1174,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1277,6 +1234,24 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperationsExtensions.cs index 46d0f01fa1c7..70cc03bacfc4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperationsExtensions.cs @@ -335,52 +335,6 @@ public static ExpressRoutePort BeginCreateOrUpdate(this IExpressRoutePortsOperat } } - /// - /// Update ExpressRoutePort tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to update ExpressRoutePort resource tags. - /// - public static ExpressRoutePort BeginUpdateTags(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, expressRoutePortName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update ExpressRoutePort tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to update ExpressRoutePort resource tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IExpressRoutePortsOperations operations, string resourceGroupName, string expressRoutePortName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, expressRoutePortName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// List all the ExpressRoutePort resources in the specified resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs index 4dea599c31c4..e6b999a3771a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs index 38b7e373ee7a..1fb4037d4610 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs @@ -119,7 +119,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -274,209 +274,6 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) return _result; } - /// - /// Updates a Firewall Policy Tags. - /// - /// - /// The resource group name of the Firewall Policy. - /// - /// - /// The name of the Firewall Policy being updated. - /// - /// - /// Parameters supplied to Update Firewall 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, TagsObject firewallPolicyParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (firewallPolicyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyName"); - } - if (firewallPolicyParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "firewallPolicyParameters"); - } - string apiVersion = "2019-08-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("firewallPolicyName", firewallPolicyName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("firewallPolicyParameters", firewallPolicyParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/firewallPolicies/{firewallPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{firewallPolicyName}", System.Uri.EscapeDataString(firewallPolicyName)); - 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(firewallPolicyParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(firewallPolicyParameters, 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Creates or updates the specified Firewall Policy. /// @@ -539,7 +336,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -717,7 +514,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -904,7 +701,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1087,7 +884,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperationsExtensions.cs index 4eb14bb3e466..d75d5ce1f67b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperationsExtensions.cs @@ -104,52 +104,6 @@ public static void Delete(this IFirewallPoliciesOperations operations, string re } } - /// - /// Updates a Firewall Policy Tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Firewall Policy. - /// - /// - /// The name of the Firewall Policy being updated. - /// - /// - /// Parameters supplied to Update Firewall Policy tags. - /// - public static FirewallPolicy UpdateTags(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, TagsObject firewallPolicyParameters) - { - return operations.UpdateTagsAsync(resourceGroupName, firewallPolicyName, firewallPolicyParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a Firewall Policy Tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Firewall Policy. - /// - /// - /// The name of the Firewall Policy being updated. - /// - /// - /// Parameters supplied to Update Firewall Policy tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateTagsAsync(this IFirewallPoliciesOperations operations, string resourceGroupName, string firewallPolicyName, TagsObject firewallPolicyParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, firewallPolicyName, firewallPolicyParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Creates or updates the specified Firewall Policy. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleGroupsOperations.cs index 05859bf57577..1728ff80a819 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleGroupsOperations.cs @@ -126,7 +126,7 @@ internal FirewallPolicyRuleGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal FirewallPolicyRuleGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal FirewallPolicyRuleGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal FirewallPolicyRuleGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs index 670bac2fb695..90667fa02904 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs @@ -101,7 +101,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +297,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationGatewaysOperations.cs index 67ca1625c09d..905d2ab3a58c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationGatewaysOperations.cs @@ -464,34 +464,6 @@ public partial interface IApplicationGatewaysOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the specified application gateway tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Parameters supplied to update application gateway 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 applicationGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Starts the specified application gateway. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationSecurityGroupsOperations.cs index 48c9c98fcb71..0acf6119286e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IApplicationSecurityGroupsOperations.cs @@ -220,34 +220,6 @@ public partial interface IApplicationSecurityGroupsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates an application security group's tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application security group. - /// - /// - /// Parameters supplied to update application security group 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 applicationSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all application security groups in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs index 8ba7e62def1f..f119488d7b32 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs @@ -100,7 +100,7 @@ public partial interface IAzureFirewallsOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates tags for an Azure Firewall resource. + /// Updates tags of an Azure Firewall resource. /// /// /// The name of the resource group. @@ -109,8 +109,7 @@ public partial interface IAzureFirewallsOperations /// The name of the Azure Firewall. /// /// - /// Parameters supplied to the create or update Azure Firewall - /// operation. + /// Parameters supplied to update azure firewall tags. /// /// /// The headers that will be added to request. @@ -127,7 +126,7 @@ public partial interface IAzureFirewallsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all Azure Firewalls in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosCustomPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosCustomPoliciesOperations.cs index d022aa0ef825..84b538b06882 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosCustomPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosCustomPoliciesOperations.cs @@ -108,7 +108,7 @@ public partial interface IDdosCustomPoliciesOperations /// The name of the DDoS custom policy. /// /// - /// Parameters supplied to the update DDoS custom policy resource tags. + /// Parameters supplied to update DDoS custom policy resource tags. /// /// /// The headers that will be added to request. @@ -176,33 +176,5 @@ public partial interface IDdosCustomPoliciesOperations /// Thrown when a required parameter is null /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosCustomPolicyName, DdosCustomPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update a DDoS custom policy tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS custom policy. - /// - /// - /// Parameters supplied to the update DDoS custom policy resource 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 ddosCustomPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosProtectionPlansOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosProtectionPlansOperations.cs index 3b541bddff54..5c25d0a4f1d4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosProtectionPlansOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IDdosProtectionPlansOperations.cs @@ -219,35 +219,6 @@ public partial interface IDdosProtectionPlansOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a DDoS protection plan tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the DDoS protection plan. - /// - /// - /// Parameters supplied to the update DDoS protection plan resource - /// 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 ddosProtectionPlanName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all DDoS protection plans in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCircuitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCircuitsOperations.cs index a6cac19e26a7..727cc7987102 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCircuitsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCircuitsOperations.cs @@ -370,34 +370,6 @@ public partial interface IExpressRouteCircuitsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates an express route circuit tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to update express route circuit 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 circuitName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets the currently advertised ARP table associated with the express /// route circuit in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCrossConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCrossConnectionsOperations.cs index e43699ad39f3..fe3c7278fe27 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCrossConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteCrossConnectionsOperations.cs @@ -273,34 +273,6 @@ public partial interface IExpressRouteCrossConnectionsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates an express route cross connection tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the cross connection. - /// - /// - /// Parameters supplied to update express route cross connection tags. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets the currently advertised ARP table associated with the express /// route cross connection in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRoutePortsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRoutePortsOperations.cs index 470fbe38b808..6ee3c892cbc3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRoutePortsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRoutePortsOperations.cs @@ -220,34 +220,6 @@ public partial interface IExpressRoutePortsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string expressRoutePortName, ExpressRoutePort parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update ExpressRoutePort tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ExpressRoutePort resource. - /// - /// - /// Parameters supplied to update ExpressRoutePort resource 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 expressRoutePortName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// List all the ExpressRoutePort resources in the specified resource /// group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IFirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IFirewallPoliciesOperations.cs index 230685701599..4b2d949c48c2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IFirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IFirewallPoliciesOperations.cs @@ -74,34 +74,6 @@ public partial interface IFirewallPoliciesOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a Firewall Policy Tags. - /// - /// - /// The resource group name of the Firewall Policy. - /// - /// - /// The name of the Firewall Policy being updated. - /// - /// - /// Parameters supplied to Update Firewall 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string firewallPolicyName, TagsObject firewallPolicyParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates or updates the specified Firewall Policy. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IIpGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IIpGroupsOperations.cs new file mode 100644 index 000000000000..0486f2c2e689 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IIpGroupsOperations.cs @@ -0,0 +1,269 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// IpGroupsOperations operations. + /// + public partial interface IIpGroupsOperations + { + /// + /// Gets the specified ipGroups. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) + /// back referenced by the IpGroups resource. + /// + /// + /// 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 ipGroupsName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups 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 ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an IpGroups + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the update ipGroups 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> UpdateGroupsWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified ipGroups. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// 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 ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all IpGroups in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all IpGroups 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)); + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups 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 ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified ipGroups. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// 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 ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all IpGroups 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)); + /// + /// Gets all IpGroups 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)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs index 640e511f8c54..cdeff94f892d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs @@ -223,34 +223,6 @@ public partial interface ILoadBalancersOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a load balancer tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to update load balancer 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 loadBalancerName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all the load balancers in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILocalNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILocalNetworkGatewaysOperations.cs index 8c45b00d5bb5..43f65ce03ce9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILocalNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILocalNetworkGatewaysOperations.cs @@ -203,34 +203,6 @@ public partial interface ILocalNetworkGatewaysOperations /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a local network gateway tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to update local network gateway 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 localNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all the local network gateways in a resource group. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkInterfacesOperations.cs index 1c44241c4224..cd895f128c9b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkInterfacesOperations.cs @@ -434,34 +434,6 @@ public partial interface INetworkInterfacesOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a network interface tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to update network interface 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 networkInterfaceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all route tables applied to a network interface. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs index 0e29c36778d3..3665edb5fbb3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs @@ -205,6 +205,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IFirewallPolicyRuleGroupsOperations FirewallPolicyRuleGroups { get; } + /// + /// Gets the IIpGroupsOperations. + /// + IIpGroupsOperations IpGroups { get; } + /// /// Gets the ILoadBalancersOperations. /// @@ -500,6 +505,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IVpnServerConfigurationsAssociatedWithVirtualWanOperations VpnServerConfigurationsAssociatedWithVirtualWan { get; } + /// + /// Gets the IVirtualHubRouteTableV2sOperations. + /// + IVirtualHubRouteTableV2sOperations VirtualHubRouteTableV2s { get; } + /// /// Gets the IWebApplicationFirewallPoliciesOperations. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityGroupsOperations.cs index 3251d7858e8d..17de1ed9c5ba 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityGroupsOperations.cs @@ -225,34 +225,6 @@ public partial interface INetworkSecurityGroupsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a network security group tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to update network security group 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 networkSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all network security groups in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IP2sVpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IP2sVpnGatewaysOperations.cs index 42b2b7b0cb01..0b65f4a39986 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IP2sVpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IP2sVpnGatewaysOperations.cs @@ -286,34 +286,6 @@ public partial interface IP2sVpnGatewaysOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway 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 gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a virtual wan p2s vpn gateway. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPrivateLinkServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPrivateLinkServicesOperations.cs index c402ee952c7a..25fa80d544ca 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPrivateLinkServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPrivateLinkServicesOperations.cs @@ -145,6 +145,38 @@ public partial interface IPrivateLinkServicesOperations /// Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get the specific private end point connection by specific private + /// link service in the resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Approve or reject private end point connection for a private link /// service in a subscription. /// @@ -204,6 +236,32 @@ public partial interface IPrivateLinkServicesOperations /// Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets all private end point connections for a specific private link + /// service. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// 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>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Checks whether the subscription is visible to private link service. /// /// @@ -431,6 +489,29 @@ public partial interface IPrivateLinkServicesOperations /// Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets all private end point connections for a specific private link + /// service. + /// + /// + /// 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>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Returns all of the private link service ids that can be linked to a /// Private Endpoint with auto approved in this subscription in this /// region. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPPrefixesOperations.cs index 471be377fc30..8cfa8c33e3fd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPPrefixesOperations.cs @@ -223,34 +223,6 @@ public partial interface IPublicIPPrefixesOperations /// 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. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs index 4a187c1e1dec..3f34cd5d07c6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs @@ -324,34 +324,6 @@ public partial interface IPublicIPAddressesOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates public IP address tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to update public IP address 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 publicIpAddressName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all the public IP addresses in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFilterRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFilterRulesOperations.cs index 311d975e85de..f79aac857d6b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFilterRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFilterRulesOperations.cs @@ -109,37 +109,6 @@ public partial interface IRouteFilterRulesOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a route in the specified route filter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all RouteFilterRules in a route filter. /// /// @@ -222,37 +191,6 @@ public partial interface IRouteFilterRulesOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, RouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a route in the specified route filter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all RouteFilterRules in a route filter. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFiltersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFiltersOperations.cs index d0c083940a3e..62059ce0cce4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFiltersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteFiltersOperations.cs @@ -102,7 +102,7 @@ public partial interface IRouteFiltersOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a route filter in a specified resource group. + /// Updates tags of a route filter. /// /// /// The name of the resource group. @@ -110,8 +110,8 @@ public partial interface IRouteFiltersOperations /// /// The name of the route filter. /// - /// - /// Parameters supplied to the update route filter operation. + /// + /// Parameters supplied to update route filter tags. /// /// /// The headers that will be added to request. @@ -128,7 +128,7 @@ public partial interface IRouteFiltersOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all route filters in a resource group. /// @@ -221,34 +221,6 @@ public partial interface IRouteFiltersOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a route filter in a specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the update route filter 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all route filters in a resource group. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteTablesOperations.cs index 1eb08cefe19a..6b890b22d3c5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IRouteTablesOperations.cs @@ -221,34 +221,6 @@ public partial interface IRouteTablesOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a route table tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to update route table 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 routeTableName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all route tables in a resource group. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceEndpointPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceEndpointPoliciesOperations.cs index 76b3039e0430..b7bae7a6c5fa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceEndpointPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceEndpointPoliciesOperations.cs @@ -104,7 +104,7 @@ public partial interface IServiceEndpointPoliciesOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates service Endpoint Policies. + /// Updates tags of a service endpoint policy. /// /// /// The name of the resource group. @@ -130,7 +130,7 @@ public partial interface IServiceEndpointPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the service endpoint policies in a subscription. /// @@ -224,34 +224,6 @@ public partial interface IServiceEndpointPoliciesOperations /// 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. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubRouteTableV2sOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubRouteTableV2sOperations.cs new file mode 100644 index 000000000000..e966557bcd3b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubRouteTableV2sOperations.cs @@ -0,0 +1,216 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// VirtualHubRouteTableV2sOperations operations. + /// + public partial interface IVirtualHubRouteTableV2sOperations + { + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// 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 virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else + /// updates the existing VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + /// + /// 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 virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// 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 virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else + /// updates the existing VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + /// + /// 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 virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// 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 virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubsOperations.cs index bdd930d48b94..1013a17cb433 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualHubsOperations.cs @@ -198,34 +198,6 @@ public partial interface IVirtualHubsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates VirtualHub tags. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to update VirtualHub 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 virtualHubName, TagsObject virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a VirtualHub. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkTapsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkTapsOperations.cs index 980b51d18119..648825f9a606 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkTapsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkTapsOperations.cs @@ -220,34 +220,6 @@ public partial interface IVirtualNetworkTapsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates an VirtualNetworkTap tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the tap. - /// - /// - /// Parameters supplied to update VirtualNetworkTap 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 tapName, TagsObject tapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all the VirtualNetworkTaps in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworksOperations.cs index 6f9ec365d4bc..82ce0f798608 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworksOperations.cs @@ -278,34 +278,6 @@ public partial interface IVirtualNetworksOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a virtual network tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to update virtual network 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 virtualNetworkName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all virtual networks in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRouterPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRouterPeeringsOperations.cs index 221deedb1a15..6439d6f4597e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRouterPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRouterPeeringsOperations.cs @@ -77,37 +77,6 @@ public partial interface IVirtualRouterPeeringsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a Virtual Router Peering. - /// - /// - /// The resource group name of the Virtual Router Peering. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering being updated. - /// - /// - /// Parameters supplied to update Virtual Router Peering operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates or updates the specified Virtual Router Peering. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRoutersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRoutersOperations.cs index f592aea98475..347a95eb8a86 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRoutersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualRoutersOperations.cs @@ -74,34 +74,6 @@ public partial interface IVirtualRoutersOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a Virtual Router. - /// - /// - /// The resource group name of the Virtual Router. - /// - /// - /// The name of the Virtual Router being updated. - /// - /// - /// Parameters supplied to Update Virtual Router 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 virtualRouterName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates or updates the specified Virtual Router. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs index dd3b00b46015..dfd795aabafe 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs @@ -198,34 +198,6 @@ public partial interface IVirtualWansOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a VirtualWAN tags. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being updated. - /// - /// - /// Parameters supplied to Update VirtualWAN 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 virtualWANName, TagsObject wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a VirtualWAN. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnGatewaysOperations.cs index 2c267aa61e5a..075057df1d9e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnGatewaysOperations.cs @@ -224,34 +224,6 @@ public partial interface IVpnGatewaysOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway 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 gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a virtual wan vpn gateway. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnServerConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnServerConfigurationsOperations.cs index b5bf1116fb7e..b3a2b40e8dc5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnServerConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnServerConfigurationsOperations.cs @@ -198,34 +198,6 @@ public partial interface IVpnServerConfigurationsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates VpnServerConfiguration tags. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being updated. - /// - /// - /// Parameters supplied to update VpnServerConfiguration 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 vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a VpnServerConfiguration. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnSitesOperations.cs index fccb3fcb515a..f7a882e52b24 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVpnSitesOperations.cs @@ -198,34 +198,6 @@ public partial interface IVpnSitesOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates VpnSite tags. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being updated. - /// - /// - /// Parameters supplied to update VpnSite 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 vpnSiteName, TagsObject vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes a VpnSite. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs index 317a7369c6a6..8c7cff0efc6a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs @@ -94,7 +94,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs new file mode 100644 index 000000000000..03087b8e2999 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs @@ -0,0 +1,1578 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// IpGroupsOperations operations. + /// + internal partial class IpGroupsOperations : IServiceOperations, IIpGroupsOperations + { + /// + /// Initializes a new instance of the IpGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IpGroupsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets the specified ipGroups. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back + /// referenced by the IpGroups resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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 ipGroupsName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ipGroupsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("ipGroupsName", ipGroupsName); + 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/ipGroups/{ipGroupsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); + _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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an IpGroups + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the update ipGroups 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> UpdateGroupsWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ipGroupsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("ipGroupsName", ipGroupsName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateGroups", 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/ipGroups/{ipGroupsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); + _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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified ipGroups. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all IpGroups 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 = "2019-09-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/ipGroups").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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all IpGroups 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 = "2019-09-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/ipGroups").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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups 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 ipGroupsName, IpGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ipGroupsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("ipGroupsName", ipGroupsName); + 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/ipGroups/{ipGroupsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); + _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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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 == 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; + } + + /// + /// Deletes the specified ipGroups. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// 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 ipGroupsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ipGroupsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ipGroupsName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("ipGroupsName", ipGroupsName); + 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/ipGroups/{ipGroupsName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ipGroupsName}", System.Uri.EscapeDataString(ipGroupsName)); + _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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all IpGroups 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all IpGroups 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..61c190b8f538 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperationsExtensions.cs @@ -0,0 +1,415 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 IpGroupsOperations. + /// + public static partial class IpGroupsOperationsExtensions + { + /// + /// Gets the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back + /// referenced by the IpGroups resource. + /// + public static IpGroup Get(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, string expand = default(string)) + { + return operations.GetAsync(resourceGroupName, ipGroupsName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back + /// referenced by the IpGroups resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ipGroupsName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups operation. + /// + public static IpGroup CreateOrUpdate(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an IpGroups + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the update ipGroups operation. + /// + public static IpGroup UpdateGroups(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, TagsObject parameters) + { + return operations.UpdateGroupsAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an IpGroups + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the update ipGroups operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateGroupsAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateGroupsWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static void Delete(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName) + { + operations.DeleteAsync(resourceGroupName, ipGroupsName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all IpGroups in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IIpGroupsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all IpGroups 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 IIpGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all IpGroups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IIpGroupsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all IpGroups in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IIpGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups operation. + /// + public static IpGroup BeginCreateOrUpdate(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an ipGroups in a specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// Parameters supplied to the create or update IpGroups operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, IpGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ipGroupsName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + public static void BeginDelete(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName) + { + operations.BeginDeleteAsync(resourceGroupName, ipGroupsName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified ipGroups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ipGroups. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IIpGroupsOperations operations, string resourceGroupName, string ipGroupsName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ipGroupsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all IpGroups 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 IIpGroupsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all IpGroups 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 IIpGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all IpGroups 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 IIpGroupsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all IpGroups 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 IIpGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs index aeb2bb35727a..cbe1c4d934a9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index a9082545f247..078c7f3dcf36 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs index b28227789dab..e3db25c66882 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs index 962ace26d461..35cca75465d2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs index fb76e230c8dc..1e468530ef67 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs index e547f475f566..170e120385cc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs index 054756007d2b..c3860c382a0b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs @@ -119,7 +119,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,22 +312,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// Parameters supplied to update load balancer tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all the load balancers in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -348,13 +332,25 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (loadBalancerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,13 +358,18 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("loadBalancerName", loadBalancerName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -382,7 +383,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -413,6 +414,12 @@ internal LoadBalancersOperations(NetworkManagementClient client) // 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) { @@ -468,7 +475,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -481,7 +488,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -501,11 +508,8 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// Gets all the load balancers in a resource group. + /// Gets all the load balancers in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -527,17 +531,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -545,15 +545,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -686,14 +684,11 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// Deletes the specified load balancer. + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the load balancer. - /// /// /// Headers that will be added to request. /// @@ -703,6 +698,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -712,21 +710,17 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (loadBalancerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -735,16 +729,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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/loadBalancers/{loadBalancerName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -758,7 +750,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -809,7 +801,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -844,13 +836,31 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -859,7 +869,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// Creates or updates a load balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. @@ -867,9 +877,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The name of the load balancer. /// - /// - /// Parameters supplied to the create or update load balancer operation. - /// /// /// Headers that will be added to request. /// @@ -879,9 +886,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -891,7 +895,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -901,15 +905,11 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,10 +919,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -942,7 +941,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -973,12 +972,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) // 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) { @@ -999,7 +992,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1034,49 +1027,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = 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); @@ -1085,7 +1042,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// Updates a load balancer tags. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. @@ -1094,7 +1051,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// The name of the load balancer. /// /// - /// Parameters supplied to update load balancer tags. + /// Parameters supplied to the create or update load balancer operation. /// /// /// Headers that will be added to request. @@ -1117,7 +1074,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1135,7 +1092,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1148,7 +1105,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1168,7 +1125,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1225,7 +1182,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1285,6 +1242,24 @@ internal LoadBalancersOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs index c0d4b6858069..9477a9b9d806 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs @@ -341,52 +341,6 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope } } - /// - /// Updates a load balancer tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to update load balancer tags. - /// - public static LoadBalancer BeginUpdateTags(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, loadBalancerName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a load balancer tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the load balancer. - /// - /// - /// Parameters supplied to update load balancer tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all the load balancers in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs index 7ffa2d862996..d897e7de2f0c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs @@ -127,7 +127,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,25 +312,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update local network gateway tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all the local network gateways in a resource group. - /// - /// - /// The name of the resource group. - /// - /// /// Headers that will be added to request. /// /// @@ -351,17 +332,32 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (localNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + } + if (localNetworkGatewayName != null) + { + if (localNetworkGatewayName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,14 +366,17 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/localNetworkGateways").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -391,7 +390,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -422,6 +421,12 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // 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) { @@ -477,7 +482,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -490,7 +495,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -510,18 +515,11 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// Creates or updates a local network gateway in the specified resource group. + /// Gets all the local network gateways in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to the create or update local network gateway - /// operation. - /// /// /// Headers that will be added to request. /// @@ -543,32 +541,17 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (localNetworkGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); - } - if (localNetworkGatewayName != null) - { - if (localNetworkGatewayName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); - } - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -577,17 +560,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/localNetworkGateways/{localNetworkGatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -601,7 +581,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -632,12 +612,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // 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) { @@ -658,7 +632,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -693,7 +667,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -706,25 +680,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -744,7 +700,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// Deletes the specified local network gateway. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -752,6 +708,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the local network gateway. /// + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// /// /// Headers that will be added to request. /// @@ -761,6 +721,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -770,7 +733,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -787,11 +750,15 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); } } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -801,9 +768,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -823,7 +791,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -854,6 +822,12 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // 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) { @@ -874,7 +848,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -909,13 +883,49 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 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); @@ -924,7 +934,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// Updates a local network gateway tags. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -932,9 +942,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to update local network gateway tags. - /// /// /// Headers that will be added to request. /// @@ -944,9 +951,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -956,7 +960,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -973,15 +977,11 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw new ValidationException(ValidationRules.MinLength, "localNetworkGatewayName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -991,10 +991,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1014,7 +1013,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1045,12 +1044,6 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // 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) { @@ -1071,7 +1064,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1106,31 +1099,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperationsExtensions.cs index 71ffdd710d1d..57ef9990085b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperationsExtensions.cs @@ -311,52 +311,6 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Updates a local network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to update local network gateway tags. - /// - public static LocalNetworkGateway BeginUpdateTags(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a local network gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. - /// - /// - /// Parameters supplied to update local network gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all the local network gateways in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs index 99ad879aa9c4..d2a622650724 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs @@ -312,19 +312,19 @@ public ApplicationGateway() public ApplicationGatewayAutoscaleConfiguration AutoscaleConfiguration { get; set; } /// - /// Gets or sets the resource GUID property of the application gateway + /// Gets the resource GUID property of the application gateway /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the application gateway - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the application gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets custom error configurations of the application gateway @@ -334,11 +334,11 @@ public ApplicationGateway() public IList CustomErrorConfigurations { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets or sets a list of availability zones denoting where the diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs index 9c903f6a69f4..6966b3f852bf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs @@ -67,12 +67,12 @@ public ApplicationGatewayAuthenticationCertificate() public string Data { get; set; } /// - /// Gets or sets the provisioning state of the authentication - /// certificate resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the authentication certificate + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the authentication certificate that is unique @@ -82,17 +82,17 @@ public ApplicationGatewayAuthenticationCertificate() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendAddressPool.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendAddressPool.cs index afa0f5e29a87..8fa6760d40ed 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendAddressPool.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendAddressPool.cs @@ -66,11 +66,10 @@ public ApplicationGatewayBackendAddressPool() partial void CustomInit(); /// - /// Gets or sets collection of references to IPs defined in network - /// interfaces. + /// Gets collection of references to IPs defined in network interfaces. /// [JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public IList BackendIPConfigurations { get; set; } + public IList BackendIPConfigurations { get; private set; } /// /// Gets or sets backend addresses. @@ -79,12 +78,12 @@ public ApplicationGatewayBackendAddressPool() public IList BackendAddresses { get; set; } /// - /// Gets or sets the provisioning state of the backend address pool - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the backend address pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the backend address pool that is unique within @@ -94,17 +93,17 @@ public ApplicationGatewayBackendAddressPool() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHttpSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHttpSettings.cs index 4005158fe12a..5a390df99144 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHttpSettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHttpSettings.cs @@ -191,12 +191,12 @@ public ApplicationGatewayBackendHttpSettings() public string Path { get; set; } /// - /// Gets or sets the provisioning state of the backend HTTP settings - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the backend HTTP settings resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the backend http settings that is unique @@ -206,17 +206,17 @@ public ApplicationGatewayBackendHttpSettings() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFirewallRuleSet.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFirewallRuleSet.cs index bb452814c529..b2507f0b52e2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFirewallRuleSet.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFirewallRuleSet.cs @@ -66,12 +66,12 @@ public ApplicationGatewayFirewallRuleSet() partial void CustomInit(); /// - /// Gets or sets the provisioning state of the web application firewall - /// rule set. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the web application firewall rule + /// set. Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the type of the web application firewall rule set. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs index 4241bbbbe552..f791cdb718b2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs @@ -97,12 +97,12 @@ public ApplicationGatewayFrontendIPConfiguration() public SubResource PublicIPAddress { get; set; } /// - /// Gets or sets the provisioning state of the frontend IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the frontend IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the frontend IP configuration that is unique @@ -112,17 +112,17 @@ public ApplicationGatewayFrontendIPConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendPort.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendPort.cs index 159131c2f595..dd472e8cf6a0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendPort.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendPort.cs @@ -67,12 +67,11 @@ public ApplicationGatewayFrontendPort() public int? Port { get; set; } /// - /// Gets or sets the provisioning state of the frontend port resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the frontend port resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the frontend port that is unique within an @@ -82,17 +81,17 @@ public ApplicationGatewayFrontendPort() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayHttpListener.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayHttpListener.cs index 1fc814824cdb..52a941c82ace 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayHttpListener.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayHttpListener.cs @@ -53,12 +53,16 @@ public ApplicationGatewayHttpListener() /// 'Updating', 'Deleting', 'Failed' /// Custom error configurations /// of the HTTP listener. + /// Reference to the FirewallPolicy + /// resource. + /// List of Host names for HTTP Listener that + /// allows special wildcard characters as well. /// Name of the HTTP listener that is unique within /// an Application Gateway. /// A unique read-only string that changes whenever /// the resource is updated. /// Type of the resource. - public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), IList customErrorConfigurations = default(IList), string name = default(string), string etag = default(string), string type = default(string)) + public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), IList customErrorConfigurations = default(IList), SubResource firewallPolicy = default(SubResource), IList hostnames = default(IList), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; @@ -69,6 +73,8 @@ public ApplicationGatewayHttpListener() RequireServerNameIndication = requireServerNameIndication; ProvisioningState = provisioningState; CustomErrorConfigurations = customErrorConfigurations; + FirewallPolicy = firewallPolicy; + Hostnames = hostnames; Name = name; Etag = etag; Type = type; @@ -120,12 +126,11 @@ public ApplicationGatewayHttpListener() public bool? RequireServerNameIndication { get; set; } /// - /// Gets or sets the provisioning state of the HTTP listener resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the HTTP listener resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets custom error configurations of the HTTP listener. @@ -133,6 +138,19 @@ public ApplicationGatewayHttpListener() [JsonProperty(PropertyName = "properties.customErrorConfigurations")] public IList CustomErrorConfigurations { get; set; } + /// + /// Gets or sets reference to the FirewallPolicy resource. + /// + [JsonProperty(PropertyName = "properties.firewallPolicy")] + public SubResource FirewallPolicy { get; set; } + + /// + /// Gets or sets list of Host names for HTTP Listener that allows + /// special wildcard characters as well. + /// + [JsonProperty(PropertyName = "properties.hostnames")] + public IList Hostnames { get; set; } + /// /// Gets or sets name of the HTTP listener that is unique within an /// Application Gateway. @@ -141,17 +159,17 @@ public ApplicationGatewayHttpListener() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs index a3f80e2bf02e..8318ffd7dee3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs @@ -70,12 +70,12 @@ public ApplicationGatewayIPConfiguration() public SubResource Subnet { get; set; } /// - /// Gets or sets the provisioning state of the application gateway IP + /// Gets the provisioning state of the application gateway IP /// configuration resource. Possible values include: 'Succeeded', /// 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the IP configuration that is unique within an @@ -85,17 +85,17 @@ public ApplicationGatewayIPConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs index 824afdac8d35..575a83ff2316 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs @@ -47,12 +47,14 @@ public ApplicationGatewayPathRule() /// The provisioning state of the path /// rule resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' + /// Reference to the FirewallPolicy + /// resource. /// Name of the path rule that is unique within an /// Application Gateway. /// A unique read-only string that changes whenever /// the resource is updated. /// Type of the resource. - public ApplicationGatewayPathRule(string id = default(string), IList paths = default(IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource rewriteRuleSet = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public ApplicationGatewayPathRule(string id = default(string), IList paths = default(IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource redirectConfiguration = default(SubResource), SubResource rewriteRuleSet = default(SubResource), string provisioningState = default(string), SubResource firewallPolicy = default(SubResource), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { Paths = paths; @@ -61,6 +63,7 @@ public ApplicationGatewayPathRule() RedirectConfiguration = redirectConfiguration; RewriteRuleSet = rewriteRuleSet; ProvisioningState = provisioningState; + FirewallPolicy = firewallPolicy; Name = name; Etag = etag; Type = type; @@ -106,12 +109,17 @@ public ApplicationGatewayPathRule() public SubResource RewriteRuleSet { get; set; } /// - /// Gets or sets the provisioning state of the path rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the path rule resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets reference to the FirewallPolicy resource. + /// + [JsonProperty(PropertyName = "properties.firewallPolicy")] + public SubResource FirewallPolicy { get; set; } /// /// Gets or sets name of the path rule that is unique within an @@ -121,17 +129,17 @@ public ApplicationGatewayPathRule() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs index 3206d5ccbbf2..1444f590718f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs @@ -159,11 +159,11 @@ public ApplicationGatewayProbe() public ApplicationGatewayProbeHealthResponseMatch Match { get; set; } /// - /// Gets or sets the provisioning state of the probe resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the probe resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets custom port which will be used for probing the backend @@ -182,17 +182,17 @@ public ApplicationGatewayProbe() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRedirectConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRedirectConfiguration.cs index d0d90f1e6dfb..5fdddb7f1bd0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRedirectConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRedirectConfiguration.cs @@ -137,17 +137,17 @@ public ApplicationGatewayRedirectConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs index 8420169e1faf..60a8efa151e4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs @@ -136,12 +136,12 @@ public ApplicationGatewayRequestRoutingRule() public SubResource RedirectConfiguration { get; set; } /// - /// Gets or sets the provisioning state of the request routing rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the request routing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the request routing rule that is unique within @@ -151,17 +151,17 @@ public ApplicationGatewayRequestRoutingRule() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslCertificate.cs index ee15b0d38856..c0f5ee27bd9d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslCertificate.cs @@ -87,11 +87,11 @@ public ApplicationGatewaySslCertificate() public string Password { get; set; } /// - /// Gets or sets base-64 encoded Public cert data corresponding to pfx + /// Gets base-64 encoded Public cert data corresponding to pfx /// specified in data. Only applicable in GET request. /// [JsonProperty(PropertyName = "properties.publicCertData")] - public string PublicCertData { get; set; } + public string PublicCertData { get; private set; } /// /// Gets or sets secret Id of (base-64 encoded unencrypted pfx) @@ -101,12 +101,12 @@ public ApplicationGatewaySslCertificate() public string KeyVaultSecretId { get; set; } /// - /// Gets or sets the provisioning state of the SSL certificate - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the SSL certificate resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the SSL certificate that is unique within an @@ -116,17 +116,17 @@ public ApplicationGatewaySslCertificate() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs index acbaef8b0c8b..ccaa2bc269b6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedRootCertificate.cs @@ -78,12 +78,12 @@ public ApplicationGatewayTrustedRootCertificate() public string KeyVaultSecretId { get; set; } /// - /// Gets or sets the provisioning state of the trusted root certificate + /// Gets the provisioning state of the trusted root certificate /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the trusted root certificate that is unique @@ -93,17 +93,17 @@ public ApplicationGatewayTrustedRootCertificate() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs index f47707ee6c79..4d236f39f797 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs @@ -108,12 +108,11 @@ public ApplicationGatewayUrlPathMap() public IList PathRules { get; set; } /// - /// Gets or sets the provisioning state of the URL path map resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the URL path map resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the URL path map that is unique within an @@ -123,17 +122,17 @@ public ApplicationGatewayUrlPathMap() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets type of the resource. + /// Gets type of the resource. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewall.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewall.cs index 191af182defe..11ded8d04066 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewall.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewall.cs @@ -60,11 +60,13 @@ public AzureFirewall() /// IP addresses associated with /// AzureFirewall. /// The Azure Firewall Resource SKU. + /// The additional properties used + /// to further config this azure firewall /// A list of availability zones denoting where the /// resource needs to come from. /// A unique read-only string that changes whenever /// the resource is updated. - public AzureFirewall(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList applicationRuleCollections = default(IList), IList natRuleCollections = default(IList), IList networkRuleCollections = default(IList), IList ipConfigurations = default(IList), string provisioningState = default(string), string threatIntelMode = default(string), SubResource virtualHub = default(SubResource), SubResource firewallPolicy = default(SubResource), HubIPAddresses hubIpAddresses = default(HubIPAddresses), AzureFirewallSku sku = default(AzureFirewallSku), IList zones = default(IList), string etag = default(string)) + public AzureFirewall(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList applicationRuleCollections = default(IList), IList natRuleCollections = default(IList), IList networkRuleCollections = default(IList), IList ipConfigurations = default(IList), string provisioningState = default(string), string threatIntelMode = default(string), SubResource virtualHub = default(SubResource), SubResource firewallPolicy = default(SubResource), HubIPAddresses hubIpAddresses = default(HubIPAddresses), AzureFirewallSku sku = default(AzureFirewallSku), IDictionary additionalProperties = default(IDictionary), IList zones = default(IList), string etag = default(string)) : base(id, name, type, location, tags) { ApplicationRuleCollections = applicationRuleCollections; @@ -77,6 +79,7 @@ public AzureFirewall() FirewallPolicy = firewallPolicy; HubIpAddresses = hubIpAddresses; Sku = sku; + AdditionalProperties = additionalProperties; Zones = zones; Etag = etag; CustomInit(); @@ -115,12 +118,12 @@ public AzureFirewall() public IList IpConfigurations { get; set; } /// - /// Gets or sets the provisioning state of the Azure firewall resource. + /// Gets the provisioning state of the Azure firewall resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the operation mode for Threat Intelligence. Possible @@ -154,6 +157,13 @@ public AzureFirewall() [JsonProperty(PropertyName = "properties.sku")] public AzureFirewallSku Sku { get; set; } + /// + /// Gets or sets the additional properties used to further config this + /// azure firewall + /// + [JsonProperty(PropertyName = "properties.additionalProperties")] + public IDictionary AdditionalProperties { get; set; } + /// /// Gets or sets a list of availability zones denoting where the /// resource needs to come from. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRule.cs index 7e8f6a82687d..1b18cbcb42da 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRule.cs @@ -40,7 +40,9 @@ public AzureFirewallApplicationRule() /// Array of ApplicationRuleProtocols. /// List of FQDNs for this rule. /// List of FQDN Tags for this rule. - public AzureFirewallApplicationRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList protocols = default(IList), IList targetFqdns = default(IList), IList fqdnTags = default(IList)) + /// List of source IpGroups for this + /// rule. + public AzureFirewallApplicationRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList protocols = default(IList), IList targetFqdns = default(IList), IList fqdnTags = default(IList), IList sourceIpGroups = default(IList)) { Name = name; Description = description; @@ -48,6 +50,7 @@ public AzureFirewallApplicationRule() Protocols = protocols; TargetFqdns = targetFqdns; FqdnTags = fqdnTags; + SourceIpGroups = sourceIpGroups; CustomInit(); } @@ -92,5 +95,11 @@ public AzureFirewallApplicationRule() [JsonProperty(PropertyName = "fqdnTags")] public IList FqdnTags { get; set; } + /// + /// Gets or sets list of source IpGroups for this rule. + /// + [JsonProperty(PropertyName = "sourceIpGroups")] + public IList SourceIpGroups { get; set; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs index 7c258a9149f7..6528bdb761cf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs @@ -87,12 +87,12 @@ public AzureFirewallApplicationRuleCollection() public IList Rules { get; set; } /// - /// Gets or sets the provisioning state of the application rule - /// collection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the application rule collection + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallIPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallIPConfiguration.cs index 769ed175cf1b..9bca126f1a8b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallIPConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallIPConfiguration.cs @@ -88,12 +88,12 @@ public AzureFirewallIPConfiguration() public SubResource PublicIPAddress { get; set; } /// - /// Gets or sets the provisioning state of the Azure firewall IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the Azure firewall IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets name of the resource that is unique within a resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRule.cs index 58d730d185b0..a8658c0a4026 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRule.cs @@ -45,7 +45,11 @@ public AzureFirewallNatRule() /// rule. /// The translated port for this NAT /// rule. - public AzureFirewallNatRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList protocols = default(IList), string translatedAddress = default(string), string translatedPort = default(string)) + /// The translated FQDN for this NAT + /// rule. + /// List of source IpGroups for this + /// rule. + public AzureFirewallNatRule(string name = default(string), string description = default(string), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList protocols = default(IList), string translatedAddress = default(string), string translatedPort = default(string), string translatedFqdn = default(string), IList sourceIpGroups = default(IList)) { Name = name; Description = description; @@ -55,6 +59,8 @@ public AzureFirewallNatRule() Protocols = protocols; TranslatedAddress = translatedAddress; TranslatedPort = translatedPort; + TranslatedFqdn = translatedFqdn; + SourceIpGroups = sourceIpGroups; CustomInit(); } @@ -113,5 +119,17 @@ public AzureFirewallNatRule() [JsonProperty(PropertyName = "translatedPort")] public string TranslatedPort { get; set; } + /// + /// Gets or sets the translated FQDN for this NAT rule. + /// + [JsonProperty(PropertyName = "translatedFqdn")] + public string TranslatedFqdn { get; set; } + + /// + /// Gets or sets list of source IpGroups for this rule. + /// + [JsonProperty(PropertyName = "sourceIpGroups")] + public IList SourceIpGroups { get; set; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs index 6d8d97a442a3..d18672edde1b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs @@ -87,12 +87,12 @@ public AzureFirewallNatRuleCollection() public IList Rules { get; set; } /// - /// Gets or sets the provisioning state of the NAT rule collection - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the NAT rule collection resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRule.cs index 40a00be7ad80..ff68b06b3b44 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRule.cs @@ -40,7 +40,12 @@ public AzureFirewallNetworkRule() /// List of destination IP /// addresses. /// List of destination ports. - public AzureFirewallNetworkRule(string name = default(string), string description = default(string), IList protocols = default(IList), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList)) + /// List of destination FQDNs. + /// List of source IpGroups for this + /// rule. + /// List of destination IpGroups for + /// this rule. + public AzureFirewallNetworkRule(string name = default(string), string description = default(string), IList protocols = default(IList), IList sourceAddresses = default(IList), IList destinationAddresses = default(IList), IList destinationPorts = default(IList), IList destinationFqdns = default(IList), IList sourceIpGroups = default(IList), IList destinationIpGroups = default(IList)) { Name = name; Description = description; @@ -48,6 +53,9 @@ public AzureFirewallNetworkRule() SourceAddresses = sourceAddresses; DestinationAddresses = destinationAddresses; DestinationPorts = destinationPorts; + DestinationFqdns = destinationFqdns; + SourceIpGroups = sourceIpGroups; + DestinationIpGroups = destinationIpGroups; CustomInit(); } @@ -92,5 +100,23 @@ public AzureFirewallNetworkRule() [JsonProperty(PropertyName = "destinationPorts")] public IList DestinationPorts { get; set; } + /// + /// Gets or sets list of destination FQDNs. + /// + [JsonProperty(PropertyName = "destinationFqdns")] + public IList DestinationFqdns { get; set; } + + /// + /// Gets or sets list of source IpGroups for this rule. + /// + [JsonProperty(PropertyName = "sourceIpGroups")] + public IList SourceIpGroups { get; set; } + + /// + /// Gets or sets list of destination IpGroups for this rule. + /// + [JsonProperty(PropertyName = "destinationIpGroups")] + public IList DestinationIpGroups { get; set; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs index 11727bffcc95..00531f0237b2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs @@ -86,12 +86,12 @@ public AzureFirewallNetworkRuleCollection() public IList Rules { get; set; } /// - /// Gets or sets the provisioning state of the network rule collection + /// Gets the provisioning state of the network rule collection /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs index 6ad56983ecc8..e69fa7ae6f55 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs @@ -100,12 +100,12 @@ public BackendAddressPool() public IList OutboundRules { get; private set; } /// - /// Gets or sets the provisioning state of the backend address pool - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the backend address pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the set @@ -116,11 +116,11 @@ public BackendAddressPool() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs index 690cc5244991..120d516f0b78 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs @@ -77,12 +77,11 @@ public BastionHost() public string DnsName { get; set; } /// - /// Gets or sets the provisioning state of the bastion host resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the bastion host resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostIPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostIPConfiguration.cs index b1750f496634..0bd55c666c8f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostIPConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostIPConfiguration.cs @@ -78,12 +78,12 @@ public BastionHostIPConfiguration() public SubResource PublicIPAddress { get; set; } /// - /// Gets or sets the provisioning state of the bastion host IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the bastion host IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets private IP allocation method. Possible values include: diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterface.cs index 71fde3999af9..17e5f180ca65 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterface.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterface.cs @@ -69,11 +69,11 @@ public ContainerNetworkInterface() partial void CustomInit(); /// - /// Gets or sets container network interface configuration from which - /// this container network interface is created. + /// Gets container network interface configuration from which this + /// container network interface is created. /// [JsonProperty(PropertyName = "properties.containerNetworkInterfaceConfiguration")] - public ContainerNetworkInterfaceConfiguration ContainerNetworkInterfaceConfiguration { get; set; } + public ContainerNetworkInterfaceConfiguration ContainerNetworkInterfaceConfiguration { get; private set; } /// /// Gets or sets reference to the container to which this container @@ -83,11 +83,10 @@ public ContainerNetworkInterface() public Container Container { get; set; } /// - /// Gets or sets reference to the ip configuration on this container - /// nic. + /// Gets reference to the ip configuration on this container nic. /// [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; set; } + public IList IpConfigurations { get; private set; } /// /// Gets the provisioning state of the container network interface @@ -111,11 +110,11 @@ public ContainerNetworkInterface() public string Type { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceConfiguration.cs index 0e02ab632134..fc0c80c88a4c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceConfiguration.cs @@ -103,11 +103,11 @@ public ContainerNetworkInterfaceConfiguration() public string Type { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs index 09bff34b97f3..41984d7ecc0f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ContainerNetworkInterfaceIpConfiguration.cs @@ -79,11 +79,11 @@ public ContainerNetworkInterfaceIpConfiguration() public string Type { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Delegation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Delegation.cs index 8f7a16e67f07..f9864a2eada5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Delegation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Delegation.cs @@ -70,11 +70,11 @@ public Delegation() public string ServiceName { get; set; } /// - /// Gets or sets describes the actions permitted to the service upon + /// Gets describes the actions permitted to the service upon /// delegation. /// [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; set; } + public IList Actions { get; private set; } /// /// Gets the provisioning state of the service delegation resource. @@ -92,11 +92,11 @@ public Delegation() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuit.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuit.cs index 5bbc4e866f01..9fb1c90c3946 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuit.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuit.cs @@ -110,18 +110,18 @@ public ExpressRouteCircuit() public bool? AllowClassicOperations { get; set; } /// - /// Gets or sets the CircuitProvisioningState state of the resource. + /// Gets the CircuitProvisioningState state of the resource. /// [JsonProperty(PropertyName = "properties.circuitProvisioningState")] - public string CircuitProvisioningState { get; set; } + public string CircuitProvisioningState { get; private set; } /// - /// Gets or sets the ServiceProviderProvisioningState state of the - /// resource. Possible values include: 'NotProvisioned', - /// 'Provisioning', 'Provisioned', 'Deprovisioning' + /// Gets the ServiceProviderProvisioningState state of the resource. + /// Possible values include: 'NotProvisioned', 'Provisioning', + /// 'Provisioned', 'Deprovisioning' /// [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] - public string ServiceProviderProvisioningState { get; set; } + public string ServiceProviderProvisioningState { get; private set; } /// /// Gets or sets the list of authorizations. @@ -136,10 +136,10 @@ public ExpressRouteCircuit() public IList Peerings { get; set; } /// - /// Gets or sets the ServiceKey. + /// Gets the ServiceKey. /// [JsonProperty(PropertyName = "properties.serviceKey")] - public string ServiceKey { get; set; } + public string ServiceKey { get; private set; } /// /// Gets or sets the ServiceProviderNotes. @@ -175,12 +175,12 @@ public ExpressRouteCircuit() public int? Stag { get; private set; } /// - /// Gets or sets the provisioning state of the express route circuit - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the express route circuit resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the GatewayManager Etag. @@ -189,10 +189,10 @@ public ExpressRouteCircuit() public string GatewayManagerEtag { get; set; } /// - /// Gets or sets flag denoting Global reach status. + /// Gets flag denoting Global reach status. /// [JsonProperty(PropertyName = "properties.globalReachEnabled")] - public bool? GlobalReachEnabled { get; set; } + public bool? GlobalReachEnabled { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitAuthorization.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitAuthorization.cs index fc16c0233779..6b9ac7eb117f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitAuthorization.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitAuthorization.cs @@ -65,25 +65,24 @@ public ExpressRouteCircuitAuthorization() partial void CustomInit(); /// - /// Gets or sets the authorization key. + /// Gets the authorization key. /// [JsonProperty(PropertyName = "properties.authorizationKey")] - public string AuthorizationKey { get; set; } + public string AuthorizationKey { get; private set; } /// - /// Gets or sets the authorization use status. Possible values include: + /// Gets the authorization use status. Possible values include: /// 'Available', 'InUse' /// [JsonProperty(PropertyName = "properties.authorizationUseStatus")] - public string AuthorizationUseStatus { get; set; } + public string AuthorizationUseStatus { get; private set; } /// - /// Gets or sets the provisioning state of the authorization resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the authorization resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitConnection.cs index c270ce9a27be..90f2ac0ef09b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitConnection.cs @@ -105,11 +105,11 @@ public ExpressRouteCircuitConnection() public string AuthorizationKey { get; set; } /// - /// Gets or sets express Route Circuit connection state. Possible - /// values include: 'Connected', 'Connecting', 'Disconnected' + /// Gets express Route Circuit connection state. Possible values + /// include: 'Connected', 'Connecting', 'Disconnected' /// [JsonProperty(PropertyName = "properties.circuitConnectionStatus")] - public string CircuitConnectionStatus { get; set; } + public string CircuitConnectionStatus { get; private set; } /// /// Gets the provisioning state of the express route circuit connection diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs index d1e6a24a5dfb..21c2b61a9031 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs @@ -126,10 +126,10 @@ public ExpressRouteCircuitPeering() public string State { get; set; } /// - /// Gets or sets the Azure ASN. + /// Gets the Azure ASN. /// [JsonProperty(PropertyName = "properties.azureASN")] - public int? AzureASN { get; set; } + public int? AzureASN { get; private set; } /// /// Gets or sets the peer ASN. @@ -150,16 +150,16 @@ public ExpressRouteCircuitPeering() public string SecondaryPeerAddressPrefix { get; set; } /// - /// Gets or sets the primary port. + /// Gets the primary port. /// [JsonProperty(PropertyName = "properties.primaryAzurePort")] - public string PrimaryAzurePort { get; set; } + public string PrimaryAzurePort { get; private set; } /// - /// Gets or sets the secondary port. + /// Gets the secondary port. /// [JsonProperty(PropertyName = "properties.secondaryAzurePort")] - public string SecondaryAzurePort { get; set; } + public string SecondaryAzurePort { get; private set; } /// /// Gets or sets the shared key. @@ -186,12 +186,12 @@ public ExpressRouteCircuitPeering() public ExpressRouteCircuitStats Stats { get; set; } /// - /// Gets or sets the provisioning state of the express route circuit - /// peering resource. Possible values include: 'Succeeded', 'Updating', + /// Gets the provisioning state of the express route circuit peering + /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the GatewayManager Etag. @@ -200,10 +200,10 @@ public ExpressRouteCircuitPeering() public string GatewayManagerEtag { get; set; } /// - /// Gets or sets who was the last to modify the peering. + /// Gets who was the last to modify the peering. /// [JsonProperty(PropertyName = "properties.lastModifiedBy")] - public string LastModifiedBy { get; set; } + public string LastModifiedBy { get; private set; } /// /// Gets or sets the reference of the RouteFilter resource. @@ -224,11 +224,11 @@ public ExpressRouteCircuitPeering() public ExpressRouteConnectionId ExpressRouteConnection { get; set; } /// - /// Gets or sets the list of circuit connections associated with Azure - /// Private Peering for this circuit. + /// Gets the list of circuit connections associated with Azure Private + /// Peering for this circuit. /// [JsonProperty(PropertyName = "properties.connections")] - public IList Connections { get; set; } + public IList Connections { get; private set; } /// /// Gets the list of peered circuit connections associated with Azure diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeeringConfig.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeeringConfig.cs index 4fe9d98a1718..63f1931a2ae7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeeringConfig.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeeringConfig.cs @@ -75,12 +75,12 @@ public ExpressRouteCircuitPeeringConfig() public IList AdvertisedCommunities { get; set; } /// - /// Gets or sets the advertised public prefix state of the Peering - /// resource. Possible values include: 'NotConfigured', 'Configuring', + /// Gets the advertised public prefix state of the Peering resource. + /// Possible values include: 'NotConfigured', 'Configuring', /// 'Configured', 'ValidationNeeded' /// [JsonProperty(PropertyName = "advertisedPublicPrefixesState")] - public string AdvertisedPublicPrefixesState { get; set; } + public string AdvertisedPublicPrefixesState { get; private set; } /// /// Gets or sets the legacy mode of the peering. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteConnection.cs index 7b48996bb902..f602e75af8e1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteConnection.cs @@ -43,13 +43,16 @@ public ExpressRouteConnection() /// connection. /// The routing weight associated to the /// connection. - public ExpressRouteConnection(ExpressRouteCircuitPeeringId expressRouteCircuitPeering, string name, string id = default(string), string provisioningState = default(string), string authorizationKey = default(string), int? routingWeight = default(int?)) + /// Enable internet + /// security. + public ExpressRouteConnection(ExpressRouteCircuitPeeringId expressRouteCircuitPeering, string name, string id = default(string), string provisioningState = default(string), string authorizationKey = default(string), int? routingWeight = default(int?), bool? enableInternetSecurity = default(bool?)) : base(id) { ProvisioningState = provisioningState; ExpressRouteCircuitPeering = expressRouteCircuitPeering; AuthorizationKey = authorizationKey; RoutingWeight = routingWeight; + EnableInternetSecurity = enableInternetSecurity; Name = name; CustomInit(); } @@ -60,12 +63,12 @@ public ExpressRouteConnection() partial void CustomInit(); /// - /// Gets or sets the provisioning state of the express route connection + /// Gets the provisioning state of the express route connection /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the ExpressRoute circuit peering. @@ -85,6 +88,12 @@ public ExpressRouteConnection() [JsonProperty(PropertyName = "properties.routingWeight")] public int? RoutingWeight { get; set; } + /// + /// Gets or sets enable internet security. + /// + [JsonProperty(PropertyName = "properties.enableInternetSecurity")] + public bool? EnableInternetSecurity { get; set; } + /// /// Gets or sets the name of the resource. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs index 998dd9f97c57..7f0342d94b6b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs @@ -176,10 +176,10 @@ public ExpressRouteCrossConnectionPeering() public string GatewayManagerEtag { get; set; } /// - /// Gets or sets who was the last to modify the peering. + /// Gets who was the last to modify the peering. /// [JsonProperty(PropertyName = "properties.lastModifiedBy")] - public string LastModifiedBy { get; set; } + public string LastModifiedBy { get; private set; } /// /// Gets or sets the IPv6 peering configuration. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteGateway.cs index 3f48c6341413..4848d622b959 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteGateway.cs @@ -79,12 +79,12 @@ public ExpressRouteGateway() public IList ExpressRouteConnections { get; private set; } /// - /// Gets or sets the provisioning state of the express route gateway - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the express route gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the Virtual Hub where the ExpressRoute gateway is or diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRoutePort.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRoutePort.cs index fa9fb092fc54..14617a4a6948 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRoutePort.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRoutePort.cs @@ -161,11 +161,10 @@ public ExpressRoutePort() public string ProvisioningState { get; private set; } /// - /// Gets or sets the resource GUID property of the express route port - /// resource. + /// Gets the resource GUID property of the express route port resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteServiceProvider.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteServiceProvider.cs index 442809843466..2d059ca682cc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteServiceProvider.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteServiceProvider.cs @@ -74,12 +74,12 @@ public ExpressRouteServiceProvider() public IList BandwidthsOffered { get; set; } /// - /// Gets or sets the provisioning state of the express route service - /// provider resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the express route service provider + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs index 6b40ff19ed24..e925a8508db2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs @@ -80,12 +80,12 @@ public FirewallPolicy() public IList RuleGroups { get; private set; } /// - /// Gets or sets the provisioning state of the firewall policy - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the firewall policy resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the parent firewall policy from which rules are diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleGroup.cs index 5851fa8af53a..939c0a82f3ed 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleGroup.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleGroup.cs @@ -77,12 +77,12 @@ public FirewallPolicyRuleGroup() public IList Rules { get; set; } /// - /// Gets or sets the provisioning state of the firewall policy rule - /// group resource. Possible values include: 'Succeeded', 'Updating', + /// Gets the provisioning state of the firewall policy rule group + /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs index d1e086f99145..e9cf2e65296e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs @@ -159,12 +159,12 @@ public FrontendIPConfiguration() public SubResource PublicIPPrefix { get; set; } /// - /// Gets or sets the provisioning state of the frontend IP - /// configuration resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the frontend IP configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the set @@ -175,11 +175,11 @@ public FrontendIPConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubVirtualNetworkConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubVirtualNetworkConnection.cs index e23df235ae3c..82e581651e3d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubVirtualNetworkConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubVirtualNetworkConnection.cs @@ -94,12 +94,12 @@ public HubVirtualNetworkConnection() public bool? EnableInternetSecurity { get; set; } /// - /// Gets or sets the provisioning state of the hub virtual network - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the hub virtual network connection + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs index 82cbb442b485..84bbf046af8d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs @@ -93,12 +93,12 @@ public IPConfiguration() public PublicIPAddress PublicIPAddress { get; set; } /// - /// Gets or sets the provisioning state of the IP configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the IP configuration resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a @@ -108,11 +108,11 @@ public IPConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfigurationProfile.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfigurationProfile.cs index 46da86248b57..4589dc88ea19 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfigurationProfile.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfigurationProfile.cs @@ -88,11 +88,11 @@ public IPConfigurationProfile() public string Type { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatPool.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatPool.cs index b0b93935f1dc..aeb0a2b0230f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatPool.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatPool.cs @@ -155,12 +155,12 @@ public InboundNatPool() public bool? EnableTcpReset { get; set; } /// - /// Gets or sets the provisioning state of the inbound NAT pool - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the inbound NAT pool resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the set @@ -171,11 +171,11 @@ public InboundNatPool() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs index 080128d4bc0d..81c585da4bfa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs @@ -154,12 +154,12 @@ public InboundNatRule() public bool? EnableTcpReset { get; set; } /// - /// Gets or sets the provisioning state of the inbound NAT rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the inbound NAT rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the set @@ -170,11 +170,11 @@ public InboundNatRule() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpGroup.cs new file mode 100644 index 000000000000..81c75746ffb3 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpGroup.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// The IpGroups resource information. + /// + [Rest.Serialization.JsonTransformation] + public partial class IpGroup : Resource + { + /// + /// Initializes a new instance of the IpGroup class. + /// + public IpGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IpGroup class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The provisioning state of the + /// IpGroups resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// IpAddresses/IpAddressPrefixes in the + /// IpGroups resource. + /// List of references to Azure resources that + /// this IpGroups is associated with + /// A unique read-only string that changes whenever + /// the resource is updated. + public IpGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList ipAddresses = default(IList), IList firewalls = default(IList), string etag = default(string)) + : base(id, name, type, location, tags) + { + ProvisioningState = provisioningState; + IpAddresses = ipAddresses; + Firewalls = firewalls; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state of the IpGroups resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets ipAddresses/IpAddressPrefixes in the IpGroups + /// resource. + /// + [JsonProperty(PropertyName = "properties.ipAddresses")] + public IList IpAddresses { get; set; } + + /// + /// Gets list of references to Azure resources that this IpGroups is + /// associated with + /// + [JsonProperty(PropertyName = "properties.firewalls")] + public IList Firewalls { get; private set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs index 5da12384cfca..eeab7ab5ea5a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs @@ -162,26 +162,24 @@ public LoadBalancer() public IList OutboundRules { get; set; } /// - /// Gets or sets the resource GUID property of the load balancer - /// resource. + /// Gets the resource GUID property of the load balancer resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the load balancer resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the load balancer resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs index 62c3884c7af3..031f68778c5d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs @@ -189,12 +189,12 @@ public LoadBalancingRule() public bool? DisableOutboundSnat { get; set; } /// - /// Gets or sets the provisioning state of the load balancing rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the load balancing rule resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the set @@ -205,11 +205,11 @@ public LoadBalancingRule() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LocalNetworkGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LocalNetworkGateway.cs index f304746dcec6..f99656624faa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LocalNetworkGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LocalNetworkGateway.cs @@ -88,11 +88,11 @@ public LocalNetworkGateway() public BgpSettings BgpSettings { get; set; } /// - /// Gets or sets the resource GUID property of the local network - /// gateway resource. + /// Gets the resource GUID property of the local network gateway + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// /// Gets the provisioning state of the local network gateway resource. @@ -103,11 +103,11 @@ public LocalNetworkGateway() public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs index 13a52d7e7860..a241d7975427 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs @@ -36,7 +36,7 @@ public MatchCondition() /// Describes operator to be matched. /// Possible values include: 'IPMatch', 'Equal', 'Contains', /// 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', - /// 'BeginsWith', 'EndsWith', 'Regex' + /// 'BeginsWith', 'EndsWith', 'Regex', 'GeoMatch' /// Match value. /// Describes if this is negate /// condition or not. @@ -66,7 +66,7 @@ public MatchCondition() /// Gets or sets describes operator to be matched. Possible values /// include: 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', /// 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', - /// 'Regex' + /// 'Regex', 'GeoMatch' /// [JsonProperty(PropertyName = "operator")] public string OperatorProperty { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatGateway.cs index 0a1b29a81f95..12a4453292b8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatGateway.cs @@ -111,19 +111,17 @@ public NatGateway() public IList Subnets { get; private set; } /// - /// Gets or sets the resource GUID property of the NAT gateway - /// resource. + /// Gets the resource GUID property of the NAT gateway resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the NAT gateway resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the NAT gateway resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets a list of availability zones denoting the zone in @@ -133,11 +131,11 @@ public NatGateway() public IList Zones { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkConfigurationDiagnosticProfile.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkConfigurationDiagnosticProfile.cs index eb3818133691..490793c0d1c3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkConfigurationDiagnosticProfile.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkConfigurationDiagnosticProfile.cs @@ -41,8 +41,7 @@ public NetworkConfigurationDiagnosticProfile() /// Traffic destination. Accepted values are: /// '*', IP Address/CIDR, Service Tag. /// Traffic destination port. Accepted - /// values are '*', port (for example, 3389) and port range (for - /// example, 80-100). + /// values are '*' and a single port in the range (0 - 65535). public NetworkConfigurationDiagnosticProfile(string direction, string protocol, string source, string destination, string destinationPort) { Direction = direction; @@ -87,8 +86,8 @@ public NetworkConfigurationDiagnosticProfile(string direction, string protocol, public string Destination { get; set; } /// - /// Gets or sets traffic destination port. Accepted values are '*', - /// port (for example, 3389) and port range (for example, 80-100). + /// Gets or sets traffic destination port. Accepted values are '*' and + /// a single port in the range (0 - 65535). /// [JsonProperty(PropertyName = "destinationPort")] public string DestinationPort { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicy.cs index 87020d20b0ad..407537217232 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicy.cs @@ -51,11 +51,11 @@ public NetworkIntentPolicy() partial void CustomInit(); /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs index 064b6cccbae5..e8427c6782b3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs @@ -119,10 +119,10 @@ public NetworkInterface() public IList IpConfigurations { get; set; } /// - /// Gets or sets a list of TapConfigurations of the network interface. + /// Gets a list of TapConfigurations of the network interface. /// [JsonProperty(PropertyName = "properties.tapConfigurations")] - public IList TapConfigurations { get; set; } + public IList TapConfigurations { get; private set; } /// /// Gets or sets the DNS settings in network interface. @@ -131,17 +131,17 @@ public NetworkInterface() public NetworkInterfaceDnsSettings DnsSettings { get; set; } /// - /// Gets or sets the MAC address of the network interface. + /// Gets the MAC address of the network interface. /// [JsonProperty(PropertyName = "properties.macAddress")] - public string MacAddress { get; set; } + public string MacAddress { get; private set; } /// - /// Gets or sets whether this is a primary network interface on a - /// virtual machine. + /// Gets whether this is a primary network interface on a virtual + /// machine. /// [JsonProperty(PropertyName = "properties.primary")] - public bool? Primary { get; set; } + public bool? Primary { get; private set; } /// /// Gets or sets if the network interface is accelerated networking @@ -164,26 +164,25 @@ public NetworkInterface() public IList HostedWorkloads { get; private set; } /// - /// Gets or sets the resource GUID property of the network interface - /// resource. + /// Gets the resource GUID property of the network interface resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the network interface - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the network interface resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceDnsSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceDnsSettings.cs index 1dd0fe7b6e59..cc4ca58f849a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceDnsSettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceDnsSettings.cs @@ -77,13 +77,13 @@ public NetworkInterfaceDnsSettings() public IList DnsServers { get; set; } /// - /// Gets or sets if the VM that uses this NIC is part of an - /// Availability Set, then this list will have the union of all DNS - /// servers from all NICs that are part of the Availability Set. This - /// property is what is configured on each of those VMs. + /// Gets if the VM that uses this NIC is part of an Availability Set, + /// then this list will have the union of all DNS servers from all NICs + /// that are part of the Availability Set. This property is what is + /// configured on each of those VMs. /// [JsonProperty(PropertyName = "appliedDnsServers")] - public IList AppliedDnsServers { get; set; } + public IList AppliedDnsServers { get; private set; } /// /// Gets or sets relative DNS name for this NIC used for internal @@ -93,20 +93,20 @@ public NetworkInterfaceDnsSettings() public string InternalDnsNameLabel { get; set; } /// - /// Gets or sets fully qualified DNS name supporting internal - /// communications between VMs in the same virtual network. + /// Gets fully qualified DNS name supporting internal communications + /// between VMs in the same virtual network. /// [JsonProperty(PropertyName = "internalFqdn")] - public string InternalFqdn { get; set; } + public string InternalFqdn { get; private set; } /// - /// Gets or sets even if internalDnsNameLabel is not specified, a DNS - /// entry is created for the primary NIC of the VM. This DNS name can - /// be constructed by concatenating the VM name with the value of + /// Gets even if internalDnsNameLabel is not specified, a DNS entry is + /// created for the primary NIC of the VM. This DNS name can be + /// constructed by concatenating the VM name with the value of /// internalDomainNameSuffix. /// [JsonProperty(PropertyName = "internalDomainNameSuffix")] - public string InternalDomainNameSuffix { get; set; } + public string InternalDomainNameSuffix { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs index 569632550f0f..b0ec3c918635 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs @@ -169,12 +169,12 @@ public NetworkInterfaceIPConfiguration() public IList ApplicationSecurityGroups { get; set; } /// - /// Gets or sets the provisioning state of the network interface IP + /// Gets the provisioning state of the network interface IP /// configuration. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets privateLinkConnection properties for the network interface. @@ -190,11 +190,11 @@ public NetworkInterfaceIPConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs index 8ecea2211418..5f7c0b2ca35f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs @@ -84,11 +84,11 @@ public NetworkInterfaceTapConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets sub Resource type. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkProfile.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkProfile.cs index 6676b6a0f4c6..6a56df2ccfcb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkProfile.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkProfile.cs @@ -67,10 +67,10 @@ public NetworkProfile() partial void CustomInit(); /// - /// Gets or sets list of child container network interfaces. + /// Gets list of child container network interfaces. /// [JsonProperty(PropertyName = "properties.containerNetworkInterfaces")] - public IList ContainerNetworkInterfaces { get; set; } + public IList ContainerNetworkInterfaces { get; private set; } /// /// Gets or sets list of chid container network interface @@ -94,11 +94,11 @@ public NetworkProfile() public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs index 47196a5eaf96..c38f49bfcf18 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs @@ -80,10 +80,10 @@ public NetworkSecurityGroup() public IList SecurityRules { get; set; } /// - /// Gets or sets the default security rules of network security group. + /// Gets the default security rules of network security group. /// [JsonProperty(PropertyName = "properties.defaultSecurityRules")] - public IList DefaultSecurityRules { get; set; } + public IList DefaultSecurityRules { get; private set; } /// /// Gets a collection of references to network interfaces. @@ -98,26 +98,26 @@ public NetworkSecurityGroup() public IList Subnets { get; private set; } /// - /// Gets or sets the resource GUID property of the network security - /// group resource. + /// Gets the resource GUID property of the network security group + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the network security group - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the network security group resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkWatcher.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkWatcher.cs index b34e1449ed58..71026bf598c0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkWatcher.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkWatcher.cs @@ -58,19 +58,19 @@ public NetworkWatcher() partial void CustomInit(); /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// - /// Gets or sets the provisioning state of the network watcher - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the network watcher resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/OutboundRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/OutboundRule.cs index a17a7f2d67fa..19756980c601 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/OutboundRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/OutboundRule.cs @@ -99,12 +99,11 @@ public OutboundRule() public SubResource BackendAddressPool { get; set; } /// - /// Gets or sets the provisioning state of the outbound rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the outbound rule resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the protocol for the outbound rule in load balancer. @@ -136,11 +135,11 @@ public OutboundRule() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SConnectionConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SConnectionConfiguration.cs index 271f0b7a4915..18759bb55424 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SConnectionConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SConnectionConfiguration.cs @@ -67,12 +67,12 @@ public P2SConnectionConfiguration() public AddressSpace VpnClientAddressPool { get; set; } /// - /// Gets or sets the provisioning state of the - /// P2SConnectionConfiguration resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the P2SConnectionConfiguration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SVpnGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SVpnGateway.cs index cc01ae90dbea..fef8a178240d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SVpnGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/P2SVpnGateway.cs @@ -41,7 +41,7 @@ public P2SVpnGateway() /// Resource tags. /// The VirtualHub to which the gateway /// belongs. - /// List of all p2s + /// List of all p2s /// connection configurations of the gateway. /// The provisioning state of the P2S /// VPN gateway resource. Possible values include: 'Succeeded', @@ -54,11 +54,11 @@ public P2SVpnGateway() /// connection health status. /// A unique read-only string that changes whenever /// the resource is updated. - public P2SVpnGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualHub = default(SubResource), IList p2sConnectionConfigurations = default(IList), string provisioningState = default(string), int? vpnGatewayScaleUnit = default(int?), VpnServerConfiguration vpnServerConfiguration = default(VpnServerConfiguration), VpnClientConnectionHealth vpnClientConnectionHealth = default(VpnClientConnectionHealth), string etag = default(string)) + public P2SVpnGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualHub = default(SubResource), IList p2SConnectionConfigurations = default(IList), string provisioningState = default(string), int? vpnGatewayScaleUnit = default(int?), SubResource vpnServerConfiguration = default(SubResource), VpnClientConnectionHealth vpnClientConnectionHealth = default(VpnClientConnectionHealth), string etag = default(string)) : base(id, name, type, location, tags) { VirtualHub = virtualHub; - P2sConnectionConfigurations = p2sConnectionConfigurations; + P2SConnectionConfigurations = p2SConnectionConfigurations; ProvisioningState = provisioningState; VpnGatewayScaleUnit = vpnGatewayScaleUnit; VpnServerConfiguration = vpnServerConfiguration; @@ -82,16 +82,16 @@ public P2SVpnGateway() /// Gets or sets list of all p2s connection configurations of the /// gateway. /// - [JsonProperty(PropertyName = "properties.p2sConnectionConfigurations")] - public IList P2sConnectionConfigurations { get; set; } + [JsonProperty(PropertyName = "properties.p2SConnectionConfigurations")] + public IList P2SConnectionConfigurations { get; set; } /// - /// Gets or sets the provisioning state of the P2S VPN gateway - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the P2S VPN gateway resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the scale unit for this p2s vpn gateway. @@ -104,7 +104,7 @@ public P2SVpnGateway() /// is attached to. /// [JsonProperty(PropertyName = "properties.vpnServerConfiguration")] - public VpnServerConfiguration VpnServerConfiguration { get; set; } + public SubResource VpnServerConfiguration { get; set; } /// /// Gets all P2S VPN clients' connection health status. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs index bdab7c6d6230..7ea2d2261735 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs @@ -85,11 +85,11 @@ public PacketCaptureResult() public string Id { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets or sets the ID of the targeted resource, only VM is currently @@ -131,12 +131,11 @@ public PacketCaptureResult() public IList Filters { get; set; } /// - /// Gets or sets the provisioning state of the packet capture session. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the packet capture session. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchRouteFilter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchRouteFilter.cs index 4678748c0209..6fef99dbf985 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchRouteFilter.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchRouteFilter.cs @@ -78,18 +78,17 @@ public PatchRouteFilter() public IList Rules { get; set; } /// - /// Gets or sets a collection of references to express route circuit - /// peerings. + /// Gets a collection of references to express route circuit peerings. /// [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; set; } + public IList Peerings { get; private set; } /// - /// Gets or sets a collection of references to express route circuit - /// ipv6 peerings. + /// Gets a collection of references to express route circuit ipv6 + /// peerings. /// [JsonProperty(PropertyName = "properties.ipv6Peerings")] - public IList Ipv6Peerings { get; set; } + public IList Ipv6Peerings { get; private set; } /// /// Gets the provisioning state of the route filter resource. Possible diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs index 2bca1c266d7a..93acaf559c12 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs @@ -86,12 +86,12 @@ public PrivateEndpoint() public IList NetworkInterfaces { get; private set; } /// - /// Gets or sets the provisioning state of the private endpoint - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the private endpoint resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets a grouping of information about the connection to the @@ -109,11 +109,11 @@ public PrivateEndpoint() public IList ManualPrivateLinkServiceConnections { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs index 1cd5f7f4ce0c..575e64c9ed23 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs @@ -41,18 +41,20 @@ public PrivateEndpointConnection() /// The provisioning state of the /// private endpoint connection resource. Possible values include: /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// The consumer link id. /// The name of the resource that is unique within a /// resource group. This name can be used to access the /// resource. /// The resource type. /// A unique read-only string that changes whenever /// the resource is updated. - public PrivateEndpointConnection(string id = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string), string name = default(string), string type = default(string), string etag = default(string)) + public PrivateEndpointConnection(string id = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string), string linkIdentifier = default(string), string name = default(string), string type = default(string), string etag = default(string)) : base(id) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; ProvisioningState = provisioningState; + LinkIdentifier = linkIdentifier; Name = name; Type = type; Etag = etag; @@ -65,10 +67,10 @@ public PrivateEndpointConnection() partial void CustomInit(); /// - /// Gets or sets the resource of private end point. + /// Gets the resource of private end point. /// [JsonProperty(PropertyName = "properties.privateEndpoint")] - public PrivateEndpoint PrivateEndpoint { get; set; } + public PrivateEndpoint PrivateEndpoint { get; private set; } /// /// Gets or sets a collection of information about the state of the @@ -78,12 +80,18 @@ public PrivateEndpointConnection() public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// - /// Gets or sets the provisioning state of the private endpoint - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the private endpoint connection + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } + + /// + /// Gets the consumer link id. + /// + [JsonProperty(PropertyName = "properties.linkIdentifier")] + public string LinkIdentifier { get; private set; } /// /// Gets or sets the name of the resource that is unique within a diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs index 469b183d4e51..130f0d9c5770 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs @@ -56,9 +56,11 @@ public PrivateLinkService() /// link service. /// The list of Fqdn. /// The alias of the private link service. + /// Whether the private link service + /// is enabled for proxy protocol or not. /// A unique read-only string that changes whenever /// the resource is updated. - public PrivateLinkService(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList loadBalancerFrontendIpConfigurations = default(IList), IList ipConfigurations = default(IList), IList networkInterfaces = default(IList), string provisioningState = default(string), IList privateEndpointConnections = default(IList), PrivateLinkServicePropertiesVisibility visibility = default(PrivateLinkServicePropertiesVisibility), PrivateLinkServicePropertiesAutoApproval autoApproval = default(PrivateLinkServicePropertiesAutoApproval), IList fqdns = default(IList), string alias = default(string), string etag = default(string)) + public PrivateLinkService(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList loadBalancerFrontendIpConfigurations = default(IList), IList ipConfigurations = default(IList), IList networkInterfaces = default(IList), string provisioningState = default(string), IList privateEndpointConnections = default(IList), PrivateLinkServicePropertiesVisibility visibility = default(PrivateLinkServicePropertiesVisibility), PrivateLinkServicePropertiesAutoApproval autoApproval = default(PrivateLinkServicePropertiesAutoApproval), IList fqdns = default(IList), string alias = default(string), bool? enableProxyProtocol = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { LoadBalancerFrontendIpConfigurations = loadBalancerFrontendIpConfigurations; @@ -70,6 +72,7 @@ public PrivateLinkService() AutoApproval = autoApproval; Fqdns = fqdns; Alias = alias; + EnableProxyProtocol = enableProxyProtocol; Etag = etag; CustomInit(); } @@ -100,19 +103,18 @@ public PrivateLinkService() public IList NetworkInterfaces { get; private set; } /// - /// Gets or sets the provisioning state of the private link service - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the private link service resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets an array of list about connections to the private - /// endpoint. + /// Gets an array of list about connections to the private endpoint. /// [JsonProperty(PropertyName = "properties.privateEndpointConnections")] - public IList PrivateEndpointConnections { get; set; } + public IList PrivateEndpointConnections { get; private set; } /// /// Gets or sets the visibility list of the private link service. @@ -139,11 +141,18 @@ public PrivateLinkService() public string Alias { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets or sets whether the private link service is enabled for proxy + /// protocol or not. + /// + [JsonProperty(PropertyName = "properties.enableProxyProtocol")] + public bool? EnableProxyProtocol { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceConnection.cs index 6a608baacae1..0419eda5fe07 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceConnection.cs @@ -77,12 +77,12 @@ public PrivateLinkServiceConnection() partial void CustomInit(); /// - /// Gets or sets the provisioning state of the private link service - /// connection resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the private link service connection + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the resource id of private link service. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceIpConfiguration.cs index 5d201cc70af9..e310d4a7132b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkServiceIpConfiguration.cs @@ -100,12 +100,12 @@ public PrivateLinkServiceIpConfiguration() public bool? Primary { get; set; } /// - /// Gets or sets the provisioning state of the private link service IP + /// Gets the provisioning state of the private link service IP /// configuration resource. Possible values include: 'Succeeded', /// 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets whether the specific IP configuration is IPv4 or IPv6. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Probe.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Probe.cs index 7ca743e3ba62..e189c75e0652 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Probe.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Probe.cs @@ -139,11 +139,11 @@ public Probe() public string RequestPath { get; set; } /// - /// Gets or sets the provisioning state of the probe resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the probe resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within the set @@ -154,11 +154,11 @@ public Probe() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets type of the resource. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs index 4cf6497356a5..767dc8fcd831 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs @@ -109,16 +109,16 @@ public PublicIPPrefix() public int? PrefixLength { get; set; } /// - /// Gets or sets the allocated Prefix. + /// Gets the allocated Prefix. /// [JsonProperty(PropertyName = "properties.ipPrefix")] - public string IpPrefix { get; set; } + public string IpPrefix { get; private set; } /// - /// Gets or sets the list of all referenced PublicIPAddresses. + /// Gets the list of all referenced PublicIPAddresses. /// [JsonProperty(PropertyName = "properties.publicIPAddresses")] - public IList PublicIPAddresses { get; set; } + public IList PublicIPAddresses { get; private set; } /// /// Gets the reference to load balancer frontend IP configuration @@ -128,26 +128,25 @@ public PublicIPPrefix() public SubResource LoadBalancerFrontendIpConfiguration { get; private set; } /// - /// Gets or sets the resource GUID property of the public IP prefix - /// resource. + /// Gets the resource GUID property of the public IP prefix resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the public IP prefix - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the public IP prefix resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets or sets a list of availability zones denoting the IP allocated diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs index 80485c6d5552..050a3d11af32 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs @@ -161,26 +161,25 @@ public PublicIPAddress() public int? IdleTimeoutInMinutes { get; set; } /// - /// Gets or sets the resource GUID property of the public IP address - /// resource. + /// Gets the resource GUID property of the public IP address resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the public IP address - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the public IP address resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Gets or sets a list of availability zones denoting the IP allocated diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Route.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Route.cs index d93e89e5d8b8..f5b1fd946ab6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Route.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Route.cs @@ -89,11 +89,11 @@ public Route() public string NextHopIpAddress { get; set; } /// - /// Gets or sets the provisioning state of the route resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Gets the provisioning state of the route resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a @@ -103,11 +103,11 @@ public Route() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteFilter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteFilter.cs index 0f59f7b7322c..5ea0384c459d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteFilter.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteFilter.cs @@ -74,18 +74,17 @@ public RouteFilter() public IList Rules { get; set; } /// - /// Gets or sets a collection of references to express route circuit - /// peerings. + /// Gets a collection of references to express route circuit peerings. /// [JsonProperty(PropertyName = "properties.peerings")] - public IList Peerings { get; set; } + public IList Peerings { get; private set; } /// - /// Gets or sets a collection of references to express route circuit - /// ipv6 peerings. + /// Gets a collection of references to express route circuit ipv6 + /// peerings. /// [JsonProperty(PropertyName = "properties.ipv6Peerings")] - public IList Ipv6Peerings { get; set; } + public IList Ipv6Peerings { get; private set; } /// /// Gets the provisioning state of the route filter resource. Possible diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteTable.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteTable.cs index 934176098c10..d8f9f41e1428 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteTable.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RouteTable.cs @@ -87,19 +87,18 @@ public RouteTable() public bool? DisableBgpRoutePropagation { get; set; } /// - /// Gets or sets the provisioning state of the route table resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the route table resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityRule.cs index 3a539da9e3f2..2d9a868dc0a0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityRule.cs @@ -222,12 +222,11 @@ public SecurityRule() public string Direction { get; set; } /// - /// Gets or sets the provisioning state of the security rule resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the security rule resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a @@ -237,11 +236,11 @@ public SecurityRule() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceAssociationLink.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceAssociationLink.cs index 6da27e70c495..336ce9e5571c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceAssociationLink.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceAssociationLink.cs @@ -116,10 +116,10 @@ public ServiceAssociationLink() public string Etag { get; private set; } /// - /// Gets or sets resource type. + /// Gets resource type. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs index a65cfded903d..feac83c23138 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs @@ -96,11 +96,11 @@ public ServiceEndpointPolicy() public string ProvisioningState { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs index 1c2ba20575b9..64925fb12dbd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs @@ -100,11 +100,11 @@ public ServiceEndpointPolicyDefinition() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPropertiesFormat.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPropertiesFormat.cs index acc83f9a1707..8ff2d54d983f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPropertiesFormat.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPropertiesFormat.cs @@ -64,12 +64,12 @@ public ServiceEndpointPropertiesFormat() public IList Locations { get; set; } /// - /// Gets or sets the provisioning state of the service endpoint - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the service endpoint resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Subnet.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Subnet.cs index a518641268f3..266bc0b76b60 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Subnet.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Subnet.cs @@ -170,18 +170,16 @@ public Subnet() public IList IpConfigurationProfiles { get; private set; } /// - /// Gets or sets an array of references to the external resources using - /// subnet. + /// Gets an array of references to the external resources using subnet. /// [JsonProperty(PropertyName = "properties.resourceNavigationLinks")] - public IList ResourceNavigationLinks { get; set; } + public IList ResourceNavigationLinks { get; private set; } /// - /// Gets or sets an array of references to services injecting into this - /// subnet. + /// Gets an array of references to services injecting into this subnet. /// [JsonProperty(PropertyName = "properties.serviceAssociationLinks")] - public IList ServiceAssociationLinks { get; set; } + public IList ServiceAssociationLinks { get; private set; } /// /// Gets or sets an array of references to the delegations on the @@ -198,12 +196,11 @@ public Subnet() public string Purpose { get; private set; } /// - /// Gets or sets the provisioning state of the subnet resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the subnet resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets enable or Disable apply network policies on private @@ -227,11 +224,11 @@ public Subnet() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs index bff525a8e66c..6ec06f301b85 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs @@ -60,9 +60,12 @@ public VirtualHub() /// 'Updating', 'Deleting', 'Failed' /// The Security Provider /// name. + /// List of all virtual hub route + /// table v2s associated with this VirtualHub. + /// The sku of this VirtualHub. /// A unique read-only string that changes whenever /// the resource is updated. - public VirtualHub(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualWan = default(SubResource), SubResource vpnGateway = default(SubResource), SubResource p2SVpnGateway = default(SubResource), SubResource expressRouteGateway = default(SubResource), SubResource azureFirewall = default(SubResource), IList virtualNetworkConnections = default(IList), string addressPrefix = default(string), VirtualHubRouteTable routeTable = default(VirtualHubRouteTable), string provisioningState = default(string), string securityProviderName = default(string), string etag = default(string)) + public VirtualHub(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualWan = default(SubResource), SubResource vpnGateway = default(SubResource), SubResource p2SVpnGateway = default(SubResource), SubResource expressRouteGateway = default(SubResource), SubResource azureFirewall = default(SubResource), IList virtualNetworkConnections = default(IList), string addressPrefix = default(string), VirtualHubRouteTable routeTable = default(VirtualHubRouteTable), string provisioningState = default(string), string securityProviderName = default(string), IList virtualHubRouteTableV2s = default(IList), string sku = default(string), string etag = default(string)) : base(id, name, type, location, tags) { VirtualWan = virtualWan; @@ -75,6 +78,8 @@ public VirtualHub() RouteTable = routeTable; ProvisioningState = provisioningState; SecurityProviderName = securityProviderName; + VirtualHubRouteTableV2s = virtualHubRouteTableV2s; + Sku = sku; Etag = etag; CustomInit(); } @@ -134,12 +139,11 @@ public VirtualHub() public VirtualHubRouteTable RouteTable { get; set; } /// - /// Gets or sets the provisioning state of the virtual hub resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the virtual hub resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the Security Provider name. @@ -147,6 +151,19 @@ public VirtualHub() [JsonProperty(PropertyName = "properties.securityProviderName")] public string SecurityProviderName { get; set; } + /// + /// Gets or sets list of all virtual hub route table v2s associated + /// with this VirtualHub. + /// + [JsonProperty(PropertyName = "properties.virtualHubRouteTableV2s")] + public IList VirtualHubRouteTableV2s { get; set; } + + /// + /// Gets or sets the sku of this VirtualHub. + /// + [JsonProperty(PropertyName = "properties.sku")] + public string Sku { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHubRouteTableV2.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHubRouteTableV2.cs new file mode 100644 index 000000000000..5c740962624f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHubRouteTableV2.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// VirtualHubRouteTableV2 Resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class VirtualHubRouteTableV2 : SubResource + { + /// + /// Initializes a new instance of the VirtualHubRouteTableV2 class. + /// + public VirtualHubRouteTableV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualHubRouteTableV2 class. + /// + /// Resource ID. + /// List of all routes. + /// List of all connections attached + /// to this route table v2. + /// The provisioning state of the + /// virtual hub route table v2 resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', '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 VirtualHubRouteTableV2(string id = default(string), IList routes = default(IList), IList attachedConnections = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + : base(id) + { + Routes = routes; + AttachedConnections = attachedConnections; + ProvisioningState = provisioningState; + Name = name; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of all routes. + /// + [JsonProperty(PropertyName = "properties.routes")] + public IList Routes { get; set; } + + /// + /// Gets or sets list of all connections attached to this route table + /// v2. + /// + [JsonProperty(PropertyName = "properties.attachedConnections")] + public IList AttachedConnections { get; set; } + + /// + /// Gets the provisioning state of the virtual hub route table v2 + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private 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 a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHubRouteV2.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHubRouteV2.cs new file mode 100644 index 000000000000..891e75c668a3 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHubRouteV2.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// VirtualHubRouteTableV2 route. + /// + public partial class VirtualHubRouteV2 + { + /// + /// Initializes a new instance of the VirtualHubRouteV2 class. + /// + public VirtualHubRouteV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualHubRouteV2 class. + /// + /// The type of destinations + /// List of all destinations. + /// The type of next hops + /// NextHops ip address. + public VirtualHubRouteV2(string destinationType = default(string), IList destinations = default(IList), string nextHopType = default(string), IList nextHops = default(IList)) + { + DestinationType = destinationType; + Destinations = destinations; + NextHopType = nextHopType; + NextHops = nextHops; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of destinations + /// + [JsonProperty(PropertyName = "destinationType")] + public string DestinationType { get; set; } + + /// + /// Gets or sets list of all destinations. + /// + [JsonProperty(PropertyName = "destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the type of next hops + /// + [JsonProperty(PropertyName = "nextHopType")] + public string NextHopType { get; set; } + + /// + /// Gets or sets nextHops ip address. + /// + [JsonProperty(PropertyName = "nextHops")] + public IList NextHops { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs index c042a0520bd8..f192de644222 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs @@ -114,19 +114,18 @@ public VirtualNetwork() public IList VirtualNetworkPeerings { get; set; } /// - /// Gets or sets the resourceGuid property of the Virtual Network - /// resource. + /// Gets the resourceGuid property of the Virtual Network resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// - /// Gets or sets the provisioning state of the virtual network - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' + /// Gets the provisioning state of the virtual network resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets indicates if DDoS protection is enabled for all the @@ -158,11 +157,11 @@ public VirtualNetwork() public VirtualNetworkBgpCommunities BgpCommunities { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs index 622bb7a40954..141be4baee96 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs @@ -183,11 +183,11 @@ public VirtualNetworkGateway() public AddressSpace CustomRoutes { get; set; } /// - /// Gets or sets the resource GUID property of the virtual network - /// gateway resource. + /// Gets the resource GUID property of the virtual network gateway + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// /// Gets the provisioning state of the virtual network gateway @@ -211,11 +211,11 @@ public VirtualNetworkGateway() public string InboundDnsForwardingEndpoint { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs index 5041292a769f..41fb8bdb7bd2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -221,11 +221,11 @@ public VirtualNetworkGatewayConnection() public IList TrafficSelectorPolicies { get; set; } /// - /// Gets or sets the resource GUID property of the virtual network - /// gateway connection resource. + /// Gets the resource GUID property of the virtual network gateway + /// connection resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// /// Gets the provisioning state of the virtual network gateway @@ -242,11 +242,11 @@ public VirtualNetworkGatewayConnection() public bool? ExpressRouteGatewayBypass { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs index f606d6b162b3..8a135e674733 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs @@ -221,11 +221,11 @@ public VirtualNetworkGatewayConnectionListEntity() public IList TrafficSelectorPolicies { get; set; } /// - /// Gets or sets the resource GUID property of the virtual network - /// gateway connection resource. + /// Gets the resource GUID property of the virtual network gateway + /// connection resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] - public string ResourceGuid { get; set; } + public string ResourceGuid { get; private set; } /// /// Gets the provisioning state of the virtual network gateway @@ -242,11 +242,11 @@ public VirtualNetworkGatewayConnectionListEntity() public bool? ExpressRouteGatewayBypass { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs index c8160db211ba..7748179f02d3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs @@ -101,11 +101,11 @@ public VirtualNetworkGatewayIPConfiguration() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewaySku.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewaySku.cs index cf19a7859fc5..83a880ef36f8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewaySku.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewaySku.cs @@ -72,10 +72,10 @@ public VirtualNetworkGatewaySku() public string Tier { get; set; } /// - /// Gets or sets the capacity. + /// Gets the capacity. /// [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; set; } + public int? Capacity { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs index f5bd102f02c0..3352ffb9be8f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs @@ -143,12 +143,12 @@ public VirtualNetworkPeering() public string PeeringState { get; set; } /// - /// Gets or sets the provisioning state of the virtual network peering + /// Gets the provisioning state of the virtual network peering /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a @@ -158,11 +158,11 @@ public VirtualNetworkPeering() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs index 51ad5de4a52d..fae7eacd4bbb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs @@ -119,11 +119,11 @@ public VirtualNetworkTap() public int? DestinationPort { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs index a66c949827a9..53005a67e6ea 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs @@ -126,9 +126,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); } - if (VirtualRouterAsn < 1) + if (VirtualRouterAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs index 171c64bf06f9..749effebc3f2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs @@ -112,9 +112,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); } - if (PeerAsn < 1) + if (PeerAsn < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualWAN.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualWAN.cs index 40501dba05d5..b19047b061d0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualWAN.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualWAN.cs @@ -54,9 +54,10 @@ public VirtualWAN() /// The provisioning state of the /// virtual WAN resource. Possible values include: 'Succeeded', /// 'Updating', 'Deleting', 'Failed' + /// The type of the VirtualWAN. /// A unique read-only string that changes whenever /// the resource is updated. - public VirtualWAN(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? disableVpnEncryption = default(bool?), IList virtualHubs = default(IList), IList vpnSites = default(IList), bool? allowBranchToBranchTraffic = default(bool?), bool? allowVnetToVnetTraffic = default(bool?), string office365LocalBreakoutCategory = default(string), string provisioningState = default(string), string etag = default(string)) + public VirtualWAN(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? disableVpnEncryption = default(bool?), IList virtualHubs = default(IList), IList vpnSites = default(IList), bool? allowBranchToBranchTraffic = default(bool?), bool? allowVnetToVnetTraffic = default(bool?), string office365LocalBreakoutCategory = default(string), string provisioningState = default(string), string virtualWANType = default(string), string etag = default(string)) : base(id, name, type, location, tags) { DisableVpnEncryption = disableVpnEncryption; @@ -66,6 +67,7 @@ public VirtualWAN() AllowVnetToVnetTraffic = allowVnetToVnetTraffic; Office365LocalBreakoutCategory = office365LocalBreakoutCategory; ProvisioningState = provisioningState; + VirtualWANType = virtualWANType; Etag = etag; CustomInit(); } @@ -113,12 +115,17 @@ public VirtualWAN() public string Office365LocalBreakoutCategory { get; set; } /// - /// Gets or sets the provisioning state of the virtual WAN resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the virtual WAN resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the type of the VirtualWAN. + /// + [JsonProperty(PropertyName = "properties.type")] + public string VirtualWANType { get; set; } /// /// Gets a unique read-only string that changes whenever the resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRevokedCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRevokedCertificate.cs index 8be3cb6890eb..164801fbae20 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRevokedCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRevokedCertificate.cs @@ -82,11 +82,11 @@ public VpnClientRevokedCertificate() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRootCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRootCertificate.cs index a58a6277742b..bd91a86fb1a5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRootCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnClientRootCertificate.cs @@ -79,11 +79,11 @@ public VpnClientRootCertificate() public string Name { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnConnection.cs index fee7e82faac9..9ebf241eaeca 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnConnection.cs @@ -188,12 +188,12 @@ public VpnConnection() public bool? UseLocalAzureIpAddress { get; set; } /// - /// Gets or sets the provisioning state of the VPN connection resource. + /// Gets the provisioning state of the VPN connection resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', /// 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets list of all vpn site link connections to the gateway. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs index 94125cd839ff..cc2a7bfbead9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs @@ -88,12 +88,11 @@ public VpnGateway() public BgpSettings BgpSettings { get; set; } /// - /// Gets or sets the provisioning state of the VPN gateway resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the VPN gateway resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the scale unit for this vpn gateway. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnServerConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnServerConfiguration.cs index bc1ce90755a1..9e4e9de111e9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnServerConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnServerConfiguration.cs @@ -46,14 +46,14 @@ public VpnServerConfiguration() /// VpnServerConfiguration. /// VPN authentication types for /// the VpnServerConfiguration. - /// VPN client - /// root certificate of VpnServerConfiguration. - /// VPN - /// client revoked certificate of VpnServerConfiguration. - /// Radius - /// Server root certificate of VpnServerConfiguration. - /// Radius - /// client root certificate of VpnServerConfiguration. + /// VPN client root certificate + /// of VpnServerConfiguration. + /// VPN client revoked + /// certificate of VpnServerConfiguration. + /// Radius Server root + /// certificate of VpnServerConfiguration. + /// Radius client root + /// certificate of VpnServerConfiguration. /// VpnClientIpsecPolicies for /// VpnServerConfiguration. /// The radius server address @@ -74,16 +74,16 @@ public VpnServerConfiguration() /// updated. /// Gets a unique read-only string that changes /// whenever the resource is updated. - public VpnServerConfiguration(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string vpnServerConfigurationName = default(string), IList vpnProtocols = default(IList), IList vpnAuthenticationTypes = default(IList), IList vpnServerConfigVpnClientRootCertificates = default(IList), IList vpnServerConfigVpnClientRevokedCertificates = default(IList), IList vpnServerConfigRadiusServerRootCertificates = default(IList), IList vpnServerConfigRadiusClientRootCertificates = default(IList), IList vpnClientIpsecPolicies = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), AadAuthenticationParameters aadAuthenticationParameters = default(AadAuthenticationParameters), string provisioningState = default(string), IList p2SVpnGateways = default(IList), string vpnServerConfigurationPropertiesEtag = default(string), string etag = default(string)) + public VpnServerConfiguration(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string vpnServerConfigurationName = default(string), IList vpnProtocols = default(IList), IList vpnAuthenticationTypes = default(IList), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList radiusServerRootCertificates = default(IList), IList radiusClientRootCertificates = default(IList), IList vpnClientIpsecPolicies = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string), AadAuthenticationParameters aadAuthenticationParameters = default(AadAuthenticationParameters), string provisioningState = default(string), IList p2SVpnGateways = default(IList), string vpnServerConfigurationPropertiesEtag = default(string), string etag = default(string)) : base(id, name, type, location, tags) { VpnServerConfigurationName = vpnServerConfigurationName; VpnProtocols = vpnProtocols; VpnAuthenticationTypes = vpnAuthenticationTypes; - VpnServerConfigVpnClientRootCertificates = vpnServerConfigVpnClientRootCertificates; - VpnServerConfigVpnClientRevokedCertificates = vpnServerConfigVpnClientRevokedCertificates; - VpnServerConfigRadiusServerRootCertificates = vpnServerConfigRadiusServerRootCertificates; - VpnServerConfigRadiusClientRootCertificates = vpnServerConfigRadiusClientRootCertificates; + VpnClientRootCertificates = vpnClientRootCertificates; + VpnClientRevokedCertificates = vpnClientRevokedCertificates; + RadiusServerRootCertificates = radiusServerRootCertificates; + RadiusClientRootCertificates = radiusClientRootCertificates; VpnClientIpsecPolicies = vpnClientIpsecPolicies; RadiusServerAddress = radiusServerAddress; RadiusServerSecret = radiusServerSecret; @@ -123,29 +123,29 @@ public VpnServerConfiguration() /// /// Gets or sets VPN client root certificate of VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnServerConfigVpnClientRootCertificates")] - public IList VpnServerConfigVpnClientRootCertificates { get; set; } + [JsonProperty(PropertyName = "properties.vpnClientRootCertificates")] + public IList VpnClientRootCertificates { get; set; } /// /// Gets or sets VPN client revoked certificate of /// VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnServerConfigVpnClientRevokedCertificates")] - public IList VpnServerConfigVpnClientRevokedCertificates { get; set; } + [JsonProperty(PropertyName = "properties.vpnClientRevokedCertificates")] + public IList VpnClientRevokedCertificates { get; set; } /// /// Gets or sets radius Server root certificate of /// VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnServerConfigRadiusServerRootCertificates")] - public IList VpnServerConfigRadiusServerRootCertificates { get; set; } + [JsonProperty(PropertyName = "properties.radiusServerRootCertificates")] + public IList RadiusServerRootCertificates { get; set; } /// /// Gets or sets radius client root certificate of /// VpnServerConfiguration. /// - [JsonProperty(PropertyName = "properties.vpnServerConfigRadiusClientRootCertificates")] - public IList VpnServerConfigRadiusClientRootCertificates { get; set; } + [JsonProperty(PropertyName = "properties.radiusClientRootCertificates")] + public IList RadiusClientRootCertificates { get; set; } /// /// Gets or sets vpnClientIpsecPolicies for VpnServerConfiguration. @@ -189,11 +189,11 @@ public VpnServerConfiguration() public IList P2SVpnGateways { get; private set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "properties.etag")] - public string VpnServerConfigurationPropertiesEtag { get; set; } + public string VpnServerConfigurationPropertiesEtag { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSite.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSite.cs index aff800679dcb..92a86b2261f8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSite.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSite.cs @@ -114,12 +114,11 @@ public VpnSite() public BgpSettings BgpProperties { get; set; } /// - /// Gets or sets the provisioning state of the VPN site resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the VPN site resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets isSecuritySite flag. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLink.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLink.cs index 0086ceae8c4c..53c7dcd41b8d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLink.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLink.cs @@ -83,12 +83,11 @@ public VpnSiteLink() public VpnLinkBgpSettings BgpProperties { get; set; } /// - /// Gets or sets the provisioning state of the VPN site link resource. - /// Possible values include: 'Succeeded', 'Updating', 'Deleting', - /// 'Failed' + /// Gets the provisioning state of the VPN site link resource. Possible + /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets a unique read-only string that changes whenever the resource diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLinkConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLinkConnection.cs index 4636f0863659..32782409a31a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLinkConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnSiteLinkConnection.cs @@ -179,12 +179,12 @@ public VpnSiteLinkConnection() public bool? UseLocalAzureIpAddress { get; set; } /// - /// Gets or sets the provisioning state of the VPN site link connection + /// Gets the provisioning state of the VPN site link connection /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the name of the resource that is unique within a diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs index 217ac1a59548..b2cb0e1ac827 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs @@ -26,5 +26,6 @@ public static class WebApplicationFirewallOperator public const string BeginsWith = "BeginsWith"; public const string EndsWith = "EndsWith"; public const string Regex = "Regex"; + public const string GeoMatch = "GeoMatch"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallPolicy.cs index 68199de1780e..f332054fc3c9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallPolicy.cs @@ -53,9 +53,13 @@ public WebApplicationFirewallPolicy() /// application firewall policy resource. Possible values include: /// 'Succeeded', 'Updating', 'Deleting', 'Failed' /// Resource status of the policy. + /// A collection of references to + /// application gateway http listeners. + /// A collection of references to + /// application gateway path rules. /// A unique read-only string that changes whenever /// the resource is updated. - public WebApplicationFirewallPolicy(ManagedRulesDefinition managedRules, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PolicySettings policySettings = default(PolicySettings), IList customRules = default(IList), IList applicationGateways = default(IList), string provisioningState = default(string), string resourceState = default(string), string etag = default(string)) + public WebApplicationFirewallPolicy(ManagedRulesDefinition managedRules, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PolicySettings policySettings = default(PolicySettings), IList customRules = default(IList), IList applicationGateways = default(IList), string provisioningState = default(string), string resourceState = default(string), IList httpListeners = default(IList), IList pathBasedRules = default(IList), string etag = default(string)) : base(id, name, type, location, tags) { PolicySettings = policySettings; @@ -64,6 +68,8 @@ public WebApplicationFirewallPolicy() ProvisioningState = provisioningState; ResourceState = resourceState; ManagedRules = managedRules; + HttpListeners = httpListeners; + PathBasedRules = pathBasedRules; Etag = etag; CustomInit(); } @@ -116,11 +122,24 @@ public WebApplicationFirewallPolicy() public ManagedRulesDefinition ManagedRules { get; set; } /// - /// Gets or sets a unique read-only string that changes whenever the - /// resource is updated. + /// Gets a collection of references to application gateway http + /// listeners. + /// + [JsonProperty(PropertyName = "properties.httpListeners")] + public IList HttpListeners { get; private set; } + + /// + /// Gets a collection of references to application gateway path rules. + /// + [JsonProperty(PropertyName = "properties.pathBasedRules")] + public IList PathBasedRules { get; private set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + public string Etag { get; private set; } /// /// Validate the object. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs index ec40c77a437f..bf60fcc33916 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs @@ -119,7 +119,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs index cbeb1b60d0a9..5a895eb657b3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs index c8ccd6469644..bb7de9ad8079 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs index a571296013fb..c5a83067f913 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs @@ -126,7 +126,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -740,7 +740,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs index abf3587bdb94..bd51b36e51ca 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs @@ -119,7 +119,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,16 +312,199 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// Parameters supplied to update network interface tags. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (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 - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + 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; } /// @@ -354,7 +537,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +720,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1839,7 +2022,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2022,7 +2205,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2197,214 +2380,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) return _result; } - /// - /// Updates a network interface tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to update network interface 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 networkInterfaceName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkInterfaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2019-08-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("networkInterfaceName", networkInterfaceName); - 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/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (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 route tables applied to a network interface. /// @@ -2449,7 +2424,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2643,7 +2618,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperationsExtensions.cs index 99dee235a3bb..147ea53da637 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperationsExtensions.cs @@ -693,52 +693,6 @@ public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperat } } - /// - /// Updates a network interface tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to update network interface tags. - /// - public static NetworkInterface BeginUpdateTags(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, networkInterfaceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a network interface tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to update network interface tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all route tables applied to a network interface. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs index a733585cfd75..5f06024c5fd6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs @@ -208,6 +208,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IFirewallPolicyRuleGroupsOperations FirewallPolicyRuleGroups { get; private set; } + /// + /// Gets the IIpGroupsOperations. + /// + public virtual IIpGroupsOperations IpGroups { get; private set; } + /// /// Gets the ILoadBalancersOperations. /// @@ -503,6 +508,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IVpnServerConfigurationsAssociatedWithVirtualWanOperations VpnServerConfigurationsAssociatedWithVirtualWan { get; private set; } + /// + /// Gets the IVirtualHubRouteTableV2sOperations. + /// + public virtual IVirtualHubRouteTableV2sOperations VirtualHubRouteTableV2s { get; private set; } + /// /// Gets the IWebApplicationFirewallPoliciesOperations. /// @@ -775,6 +785,7 @@ private void Initialize() ExpressRouteLinks = new ExpressRouteLinksOperations(this); FirewallPolicies = new FirewallPoliciesOperations(this); FirewallPolicyRuleGroups = new FirewallPolicyRuleGroupsOperations(this); + IpGroups = new IpGroupsOperations(this); LoadBalancers = new LoadBalancersOperations(this); LoadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsOperations(this); LoadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsOperations(this); @@ -834,6 +845,7 @@ private void Initialize() VpnLinkConnections = new VpnLinkConnectionsOperations(this); P2sVpnGateways = new P2sVpnGatewaysOperations(this); VpnServerConfigurationsAssociatedWithVirtualWan = new VpnServerConfigurationsAssociatedWithVirtualWanOperations(this); + VirtualHubRouteTableV2s = new VirtualHubRouteTableV2sOperations(this); WebApplicationFirewallPolicies = new WebApplicationFirewallPoliciesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; @@ -919,7 +931,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1117,7 +1129,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1351,7 +1363,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "vpnClientParams"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs index e8212d00682c..21a2057f02a4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs @@ -119,7 +119,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,7 +738,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -921,7 +921,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1110,7 +1110,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs index 042d89c86cdf..5e301fae6ed6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs @@ -119,7 +119,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -314,22 +314,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// Parameters supplied to update network security group tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all network security groups in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -350,13 +334,25 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -364,13 +360,18 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -384,7 +385,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -415,6 +416,12 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // 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) { @@ -470,7 +477,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -483,7 +490,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -503,11 +510,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Gets all network security groups in a resource group. + /// Gets all network security groups in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -529,17 +533,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -547,15 +547,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -688,14 +686,11 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Deletes the specified network security group. + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// /// /// Headers that will be added to request. /// @@ -705,6 +700,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -714,21 +712,17 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkSecurityGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,16 +731,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -760,7 +752,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -811,7 +803,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -846,13 +838,31 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -861,8 +871,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Creates or updates a network security group in the specified resource - /// group. + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -870,10 +879,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The name of the network security group. /// - /// - /// Parameters supplied to the create or update network security group - /// operation. - /// /// /// Headers that will be added to request. /// @@ -883,9 +888,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -895,7 +897,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -905,15 +907,11 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -923,10 +921,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -946,7 +943,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -977,12 +974,6 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // 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) { @@ -1003,7 +994,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1038,49 +1029,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = 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); @@ -1089,7 +1044,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// Updates a network security group tags. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. @@ -1098,7 +1054,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// The name of the network security group. /// /// - /// Parameters supplied to update network security group tags. + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// Headers that will be added to request. @@ -1121,7 +1078,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1139,7 +1096,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1152,7 +1109,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1172,7 +1129,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1229,7 +1186,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1289,6 +1246,24 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperationsExtensions.cs index 4ee4d3c45ff1..64af2a9c38db 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperationsExtensions.cs @@ -349,52 +349,6 @@ public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGrou } } - /// - /// Updates a network security group tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to update network security group tags. - /// - public static NetworkSecurityGroup BeginUpdateTags(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a network security group tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to update network security group tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all network security groups in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs index 2aae46e11621..ff8b6d9f8b0a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs @@ -101,7 +101,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -315,7 +315,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -533,7 +533,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -895,7 +895,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1087,7 +1087,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1569,7 +1569,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1752,7 +1752,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1977,7 +1977,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2202,7 +2202,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2427,7 +2427,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2652,7 +2652,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2878,7 +2878,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3105,7 +3105,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3332,7 +3332,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3558,7 +3558,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3780,7 +3780,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4011,7 +4011,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs index 587da4db7ef2..a9a09f0a3e75 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs index 56a267f6476a..5cdd91336973 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -283,47 +283,6 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update a virtual wan p2s vpn gateway tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a virtual wan p2s vpn gateway. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the P2SVpnGateways in a resource group. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// /// Headers that will be added to request. /// /// @@ -344,7 +303,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -354,7 +313,15 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (p2SVpnGatewayParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,15 +330,18 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("p2SVpnGatewayParameters", p2SVpnGatewayParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/p2svpnGateways").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -384,7 +354,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -415,6 +385,12 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(p2SVpnGatewayParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(p2SVpnGatewayParameters, 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) { @@ -470,7 +446,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -483,7 +459,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -503,8 +479,33 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) } /// - /// Lists all the P2SVpnGateways in a subscription. + /// Deletes a virtual wan p2s vpn gateway. + /// + /// + /// The resource group name of the P2SVpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the P2SVpnGateways in a resource group. /// + /// + /// The resource group name of the P2SVpnGateway. + /// /// /// Headers that will be added to request. /// @@ -526,13 +527,17 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,14 +545,16 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/p2svpnGateways").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -679,94 +686,8 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) } /// - /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified - /// resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Parameters supplied to the generate P2SVpnGateway VPN client package - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway - /// in the specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> GetP2sVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginGetP2sVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the sas url to get the connection health detail of P2S clients of the - /// virtual wan P2SVpnGateway in the specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the P2SVpnGateway. - /// - /// - /// Request parameters supplied to get p2s vpn connections detailed health. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> GetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginGetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - /// existing gateway. + /// Lists all the P2SVpnGateways in a subscription. /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. - /// /// /// Headers that will be added to request. /// @@ -788,25 +709,13 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (p2SVpnGatewayParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -814,19 +723,14 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("p2SVpnGatewayParameters", p2SVpnGatewayParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/p2svpnGateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -839,7 +743,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -870,12 +774,6 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(p2SVpnGatewayParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(p2SVpnGatewayParameters, 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) { @@ -896,7 +794,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -931,7 +829,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -944,25 +842,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -982,7 +862,84 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) } /// - /// Updates virtual wan p2s vpn gateway tags. + /// Generates VPN profile for P2S client of the P2SVpnGateway in the specified + /// resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// Parameters supplied to the generate P2SVpnGateway VPN client package + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GenerateVpnProfileWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnProfileParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGenerateVpnProfileWithHttpMessagesAsync(resourceGroupName, gatewayName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the connection health of P2S clients of the virtual wan P2SVpnGateway + /// in the specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetP2sVpnConnectionHealthWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetP2sVpnConnectionHealthWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the sas url to get the connection health detail of P2S clients of the + /// virtual wan P2SVpnGateway in the specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the P2SVpnGateway. + /// + /// + /// Request parameters supplied to get p2s vpn connections detailed health. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnConnectionHealthRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetP2sVpnConnectionHealthDetailedWithHttpMessagesAsync(resourceGroupName, gatewayName, request, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the + /// existing gateway. /// /// /// The resource group name of the P2SVpnGateway. @@ -991,7 +948,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// The name of the gateway. /// /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. + /// Parameters supplied to create or Update a virtual wan p2s vpn gateway. /// /// /// Headers that will be added to request. @@ -1014,7 +971,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, P2SVpnGateway p2SVpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1032,7 +989,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1045,7 +1002,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("p2SVpnGatewayParameters", p2SVpnGatewayParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1065,7 +1022,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1248,7 +1205,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1433,7 +1390,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1635,7 +1592,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1837,7 +1794,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperationsExtensions.cs index 1c0202a7236a..f28af3e469e3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperationsExtensions.cs @@ -442,52 +442,6 @@ public static P2SVpnGateway BeginCreateOrUpdate(this IP2sVpnGatewaysOperations o } } - /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. - /// - public static P2SVpnGateway BeginUpdateTags(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates virtual wan p2s vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the P2SVpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan p2s vpn gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IP2sVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject p2SVpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a virtual wan p2s vpn gateway. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs index 9cf778a3603a..1fa73f482a4d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs @@ -129,7 +129,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -395,7 +395,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -602,7 +602,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -804,7 +804,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -981,7 +981,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1161,7 +1161,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs index 493ae1fcb8f4..289956cd59e1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs @@ -109,7 +109,7 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -315,7 +315,7 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs index 452b0af8717e..372f0434fc68 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs @@ -119,7 +119,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +686,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -864,7 +864,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs index acaeec40bce7..b76f0186f969 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs @@ -119,7 +119,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -645,6 +645,213 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) return _result; } + /// + /// Get the specific private end point connection by specific private link + /// service in the resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (peConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("serviceName", serviceName); + tracingParameters.Add("peConnectionName", peConnectionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateEndpointConnection", 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/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{peConnectionName}", System.Uri.EscapeDataString(peConnectionName)); + _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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Approve or reject private end point connection for a private link service /// in a subscription. @@ -658,8 +865,240 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// The name of the private end point connection. /// - /// - /// Parameters supplied to approve or reject the private end point connection. + /// + /// Parameters supplied to approve or reject the private end point connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (peConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peConnectionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2019-09-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("serviceName", serviceName); + tracingParameters.Add("peConnectionName", peConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdatePrivateEndpointConnection", 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/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{peConnectionName}", System.Uri.EscapeDataString(peConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete private end point connection for a private link service in a + /// subscription. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. /// /// /// Headers that will be added to request. @@ -682,7 +1121,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -692,19 +1131,11 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } - if (peConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peConnectionName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,18 +1145,15 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("peConnectionName", peConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdatePrivateEndpointConnection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnections", 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/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{peConnectionName}", System.Uri.EscapeDataString(peConnectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -739,7 +1167,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -770,12 +1198,6 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) // 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) { @@ -826,7 +1248,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -839,7 +1261,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -858,32 +1280,6 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) return _result; } - /// - /// Delete private end point connection for a private link service in a - /// subscription. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the private link service. - /// - /// - /// The name of the private end point connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string serviceName, string peConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Checks whether the subscription is visible to private link service. /// @@ -928,7 +1324,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1531,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1330,7 +1726,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1523,7 +1919,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1714,7 +2110,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1892,7 +2288,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2111,7 +2507,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2576,6 +2972,174 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) return _result; } + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// 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>> ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(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, "ListPrivateEndpointConnectionsNext", 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Returns all of the private link service ids that can be linked to a Private /// Endpoint with auto approved in this subscription in this region. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperationsExtensions.cs index bad1cffa7708..9da1243c72e3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperationsExtensions.cs @@ -212,6 +212,60 @@ public static IPage ListBySubscription(this IPrivateLinkServ } } + /// + /// Get the specific private end point connection by specific private link + /// service in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// Expands referenced resources. + /// + public static PrivateEndpointConnection GetPrivateEndpointConnection(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string)) + { + return operations.GetPrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, expand).GetAwaiter().GetResult(); + } + + /// + /// Get the specific private end point connection by specific private link + /// service in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The name of the private end point connection. + /// + /// + /// Expands referenced resources. + /// + /// + /// The cancellation token. + /// + public static async Task GetPrivateEndpointConnectionAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, string peConnectionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Approve or reject private end point connection for a private link service /// in a subscription. @@ -311,6 +365,46 @@ public static void DeletePrivateEndpointConnection(this IPrivateLinkServicesOper (await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, serviceName, peConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + public static IPage ListPrivateEndpointConnections(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName) + { + return operations.ListPrivateEndpointConnectionsAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the private link service. + /// + /// + /// The cancellation token. + /// + public static async Task> ListPrivateEndpointConnectionsAsync(this IPrivateLinkServicesOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListPrivateEndpointConnectionsWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Checks whether the subscription is visible to private link service. /// @@ -673,6 +767,40 @@ public static IPage ListBySubscriptionNext(this IPrivateLink } } + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListPrivateEndpointConnectionsNext(this IPrivateLinkServicesOperations operations, string nextPageLink) + { + return operations.ListPrivateEndpointConnectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all private end point connections for a specific private link service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListPrivateEndpointConnectionsNextAsync(this IPrivateLinkServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListPrivateEndpointConnectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Returns all of the private link service ids that can be linked to a Private /// Endpoint with auto approved in this subscription in this region. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs index 28c82bc1bfbc..b986eeea39b4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs @@ -119,7 +119,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,22 +312,6 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// 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. /// /// @@ -348,13 +332,25 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,13 +358,18 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { _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, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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(); + 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) @@ -382,7 +383,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -413,6 +414,12 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) // 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) { @@ -468,7 +475,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -481,7 +488,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -501,11 +508,8 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) } /// - /// Gets all public IP prefixes in a resource group. + /// Gets all the public IP prefixes in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -527,17 +531,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -545,15 +545,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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) @@ -686,14 +684,11 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) } /// - /// Deletes the specified public IP prefix. + /// Gets all public IP prefixes in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the PublicIpPrefix. - /// /// /// Headers that will be added to request. /// @@ -703,6 +698,9 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -712,21 +710,17 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// 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)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -735,16 +729,14 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) _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); + 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/{publicIpPrefixName}").ToString(); + 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("{publicIpPrefixName}", System.Uri.EscapeDataString(publicIpPrefixName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -758,7 +750,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -809,7 +801,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -844,13 +836,31 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -859,16 +869,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) } /// - /// Creates or updates a static or dynamic public IP prefix. + /// Deletes the specified 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 name of the PublicIpPrefix. /// /// /// Headers that will be added to request. @@ -879,9 +886,6 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -891,7 +895,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// 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)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -901,15 +905,11 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,10 +919,9 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) 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); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -942,7 +941,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -973,12 +972,6 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) // 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) { @@ -999,7 +992,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1034,49 +1027,13 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1085,7 +1042,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) } /// - /// Updates public IP prefix tags. + /// Creates or updates a static or dynamic public IP prefix. /// /// /// The name of the resource group. @@ -1094,7 +1051,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// The name of the public IP prefix. /// /// - /// Parameters supplied to update public IP prefix tags. + /// Parameters supplied to the create or update public IP prefix operation. /// /// /// Headers that will be added to request. @@ -1117,7 +1074,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) /// /// 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)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpPrefixName, PublicIPPrefix parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1135,7 +1092,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1148,7 +1105,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1168,7 +1125,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1225,7 +1182,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1285,6 +1242,24 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperationsExtensions.cs index 395e189680b1..1d530bd43edb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperationsExtensions.cs @@ -341,52 +341,6 @@ public static PublicIPPrefix BeginCreateOrUpdate(this IPublicIPPrefixesOperation } } - /// - /// 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. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs index 0ff375b3c53a..10a69b633fce 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs @@ -119,7 +119,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,22 +312,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// Parameters supplied to update public IP address tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all the public IP addresses in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -348,13 +332,25 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (publicIpAddressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,13 +358,18 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpAddressName", publicIpAddressName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -382,7 +383,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -413,6 +414,12 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // 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) { @@ -468,7 +475,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -481,7 +488,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -501,11 +508,8 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Gets all public IP addresses in a resource group. + /// Gets all the public IP addresses in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -527,17 +531,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -545,15 +545,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -686,15 +684,11 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Gets information about all public IP addresses on a virtual machine scale - /// set level. + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual machine scale set. - /// /// /// Headers that will be added to request. /// @@ -716,21 +710,17 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualMachineScaleSetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-10-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -739,16 +729,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetPublicIPAddresses", tracingParameters); + 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -881,8 +869,8 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Gets information about all public IP addresses in a virtual machine IP - /// configuration in a virtual machine scale set. + /// Gets information about all public IP addresses on a virtual machine scale + /// set level. /// /// /// The name of the resource group. @@ -890,15 +878,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The name of the virtual machine scale set. /// - /// - /// The virtual machine index. - /// - /// - /// The network interface name. - /// - /// - /// The IP configuration name. - /// /// /// Headers that will be added to request. /// @@ -920,7 +899,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVirtualMachineScaleSetPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -930,18 +909,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } - if (virtualmachineIndex == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); - } - if (networkInterfaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); - } - if (ipConfigurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -956,21 +923,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); - tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("ipConfigurationName", ipConfigurationName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMPublicIPAddresses", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetPublicIPAddresses", 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1103,7 +1064,8 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Get the specified public IP address in a virtual machine scale set. + /// Gets information about all public IP addresses in a virtual machine IP + /// configuration in a virtual machine scale set. /// /// /// The name of the resource group. @@ -1115,16 +1077,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// The virtual machine index. /// /// - /// The name of the network interface. + /// The network interface name. /// /// - /// The name of the IP configuration. - /// - /// - /// The name of the public IP Address. - /// - /// - /// Expands referenced resources. + /// The IP configuration name. /// /// /// Headers that will be added to request. @@ -1147,7 +1103,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVirtualMachineScaleSetVMPublicIPAddressesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1169,10 +1125,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); } - if (publicIpAddressName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1190,31 +1142,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("ipConfigurationName", ipConfigurationName); - tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetPublicIPAddress", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMPublicIPAddresses", 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); - _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _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); @@ -1308,7 +1253,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1321,7 +1266,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1341,13 +1286,28 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Deletes the specified public IP address. + /// Get the specified public IP address in a virtual machine scale set. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. + /// + /// + /// The name of the network interface. + /// + /// + /// The name of the IP configuration. + /// /// - /// The name of the subnet. + /// The name of the public IP Address. + /// + /// + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -1358,6 +1318,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1367,12 +1330,28 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVirtualMachineScaleSetPublicIPAddressWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string ipConfigurationName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (virtualMachineScaleSetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); + } + if (virtualmachineIndex == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + } + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (ipConfigurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigurationName"); + } if (publicIpAddressName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); @@ -1381,7 +1360,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2018-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1390,15 +1369,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); + tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("ipConfigurationName", ipConfigurationName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetPublicIPAddress", 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/publicIPAddresses/{publicIpAddressName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{ipConfigurationName}", System.Uri.EscapeDataString(ipConfigurationName)); _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -1406,6 +1394,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _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); @@ -1413,7 +1405,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1464,7 +1456,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1499,13 +1491,31 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -1514,16 +1524,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Creates or updates a static or dynamic public IP address. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to the create or update public IP address operation. + /// The name of the subnet. /// /// /// Headers that will be added to request. @@ -1534,9 +1541,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1546,7 +1550,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1556,15 +1560,11 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1574,10 +1574,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1597,7 +1596,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1628,12 +1627,6 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // 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) { @@ -1654,7 +1647,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1689,49 +1682,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = 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); @@ -1740,7 +1697,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// Updates public IP address tags. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. @@ -1749,7 +1706,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// The name of the public IP address. /// /// - /// Parameters supplied to update public IP address tags. + /// Parameters supplied to the create or update public IP address operation. /// /// /// Headers that will be added to request. @@ -1772,7 +1729,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1790,7 +1747,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1803,7 +1760,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1823,7 +1780,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1880,7 +1837,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1940,6 +1897,24 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs index 439cbe4ae9ff..fff1a3acb322 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs @@ -513,52 +513,6 @@ public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperati } } - /// - /// Updates public IP address tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to update public IP address tags. - /// - public static PublicIPAddress BeginUpdateTags(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates public IP address tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the public IP address. - /// - /// - /// Parameters supplied to update public IP address tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all the public IP addresses in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs index 298ab37799e3..2dae51a4b38f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs @@ -101,7 +101,7 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs index 292b164e1a73..e1756ef9d6ae 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs @@ -126,7 +126,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -306,34 +306,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } - /// - /// Updates a route in the specified route filter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Gets all RouteFilterRules in a route filter. /// @@ -378,7 +350,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -576,7 +548,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -772,7 +744,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -949,223 +921,6 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) return _result; } - /// - /// Updates a route in the specified route filter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (routeFilterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - if (routeFilterRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterRuleParameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2019-08-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("routeFilterName", routeFilterName); - tracingParameters.Add("ruleName", ruleName); - tracingParameters.Add("routeFilterRuleParameters", routeFilterRuleParameters); - 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); - _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _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(routeFilterRuleParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeFilterRuleParameters, 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 RouteFilterRules in a route filter. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperationsExtensions.cs index 027a8bac892e..981707b7a41d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperationsExtensions.cs @@ -162,58 +162,6 @@ public static RouteFilterRule CreateOrUpdate(this IRouteFilterRulesOperations op } } - /// - /// Updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule operation. - /// - public static RouteFilterRule Update(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters) - { - return operations.UpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all RouteFilterRules in a route filter. /// @@ -349,58 +297,6 @@ public static RouteFilterRule BeginCreateOrUpdate(this IRouteFilterRulesOperatio } } - /// - /// Updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule operation. - /// - public static RouteFilterRule BeginUpdate(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a route in the specified route filter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// The name of the route filter rule. - /// - /// - /// Parameters supplied to the update route filter rule operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IRouteFilterRulesOperations operations, string resourceGroupName, string routeFilterName, string ruleName, PatchRouteFilterRule routeFilterRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all RouteFilterRules in a route filter. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs index 8186b85c7c57..bc852b672f6e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs @@ -119,7 +119,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -300,7 +300,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) } /// - /// Updates a route filter in a specified resource group. + /// Updates tags of a route filter. /// /// /// The name of the resource group. @@ -308,27 +308,8 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The name of the route filter. /// - /// - /// Parameters supplied to the update route filter operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all route filters in a resource group. - /// - /// - /// The name of the resource group. + /// + /// Parameters supplied to update route filter tags. /// /// /// Headers that will be added to request. @@ -351,17 +332,25 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeFilterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,14 +359,17 @@ internal RouteFiltersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("routeFilterName", routeFilterName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/routeFilters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -391,7 +383,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -422,6 +414,12 @@ internal RouteFiltersOperations(NetworkManagementClient client) // 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) { @@ -477,7 +475,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -490,7 +488,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -510,8 +508,11 @@ internal RouteFiltersOperations(NetworkManagementClient client) } /// - /// Gets all route filters in a subscription. + /// Gets all route filters in a resource group. /// + /// + /// The name of the resource group. + /// /// /// Headers that will be added to request. /// @@ -533,13 +534,17 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -547,13 +552,15 @@ internal RouteFiltersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/routeFilters").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters").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) @@ -686,14 +693,8 @@ internal RouteFiltersOperations(NetworkManagementClient client) } /// - /// Deletes the specified route filter. + /// Gets all route filters in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// /// /// Headers that will be added to request. /// @@ -703,6 +704,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -712,21 +716,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (routeFilterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -734,17 +730,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("routeFilterName", routeFilterName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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/routeFilters/{routeFilterName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeFilterName}", System.Uri.EscapeDataString(routeFilterName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -758,7 +750,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -809,7 +801,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -844,13 +836,31 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -859,7 +869,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) } /// - /// Creates or updates a route filter in a specified resource group. + /// Deletes the specified route filter. /// /// /// The name of the resource group. @@ -867,9 +877,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// The name of the route filter. /// - /// - /// Parameters supplied to the create or update route filter operation. - /// /// /// Headers that will be added to request. /// @@ -879,9 +886,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -891,7 +895,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -901,15 +905,11 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterName"); } - if (routeFilterParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeFilterParameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,10 +919,9 @@ internal RouteFiltersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeFilterName", routeFilterName); - tracingParameters.Add("routeFilterParameters", routeFilterParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -942,7 +941,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -973,12 +972,6 @@ internal RouteFiltersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(routeFilterParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeFilterParameters, 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) { @@ -999,7 +992,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1034,49 +1027,13 @@ internal RouteFiltersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1085,7 +1042,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) } /// - /// Updates a route filter in a specified resource group. + /// Creates or updates a route filter in a specified resource group. /// /// /// The name of the resource group. @@ -1094,7 +1051,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// The name of the route filter. /// /// - /// Parameters supplied to the update route filter operation. + /// Parameters supplied to the create or update route filter operation. /// /// /// Headers that will be added to request. @@ -1117,7 +1074,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeFilterName, RouteFilter routeFilterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1135,7 +1092,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1148,7 +1105,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) tracingParameters.Add("routeFilterParameters", routeFilterParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1168,7 +1125,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1225,7 +1182,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1285,6 +1242,24 @@ internal RouteFiltersOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperationsExtensions.cs index c4363524b335..01e7971501c6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperationsExtensions.cs @@ -151,7 +151,7 @@ public static RouteFilter CreateOrUpdate(this IRouteFiltersOperations operations } /// - /// Updates a route filter in a specified resource group. + /// Updates tags of a route filter. /// /// /// The operations group for this extension method. @@ -162,16 +162,16 @@ public static RouteFilter CreateOrUpdate(this IRouteFiltersOperations operations /// /// The name of the route filter. /// - /// - /// Parameters supplied to the update route filter operation. + /// + /// Parameters supplied to update route filter tags. /// - public static RouteFilter Update(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters) + public static RouteFilter UpdateTags(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, TagsObject parameters) { - return operations.UpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).GetAwaiter().GetResult(); + return operations.UpdateTagsAsync(resourceGroupName, routeFilterName, parameters).GetAwaiter().GetResult(); } /// - /// Updates a route filter in a specified resource group. + /// Updates tags of a route filter. /// /// /// The operations group for this extension method. @@ -182,15 +182,15 @@ public static RouteFilter Update(this IRouteFiltersOperations operations, string /// /// The name of the route filter. /// - /// - /// Parameters supplied to the update route filter operation. + /// + /// Parameters supplied to update route filter tags. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateTagsAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, routeFilterName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -341,52 +341,6 @@ public static RouteFilter BeginCreateOrUpdate(this IRouteFiltersOperations opera } } - /// - /// Updates a route filter in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the update route filter operation. - /// - public static RouteFilter BeginUpdate(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a route filter in a specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route filter. - /// - /// - /// Parameters supplied to the update route filter operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IRouteFiltersOperations operations, string resourceGroupName, string routeFilterName, PatchRouteFilter routeFilterParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, routeFilterName, routeFilterParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all route filters in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs index 8df6b0797264..bf4bc9deeba5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs @@ -119,7 +119,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,25 +312,6 @@ internal RouteTablesOperations(NetworkManagementClient client) /// Parameters supplied to update route table tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all route tables in a resource group. - /// - /// - /// The name of the resource group. - /// - /// /// Headers that will be added to request. /// /// @@ -351,17 +332,25 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (routeTableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,14 +359,17 @@ internal RouteTablesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/routeTables").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -391,7 +383,7 @@ internal RouteTablesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -422,6 +414,12 @@ internal RouteTablesOperations(NetworkManagementClient client) // 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) { @@ -477,7 +475,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -490,7 +488,7 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -510,8 +508,11 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// Gets all route tables in a subscription. + /// Gets all route tables in a resource group. /// + /// + /// The name of the resource group. + /// /// /// Headers that will be added to request. /// @@ -533,13 +534,17 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -547,13 +552,15 @@ internal RouteTablesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + 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/routeTables").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -686,14 +693,8 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// Deletes the specified route table. + /// Gets all route tables in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// /// /// Headers that will be added to request. /// @@ -703,6 +704,9 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -712,21 +716,13 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (routeTableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -734,17 +730,13 @@ internal RouteTablesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -758,7 +750,7 @@ internal RouteTablesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -809,7 +801,7 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -844,13 +836,31 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -859,7 +869,7 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// Create or updates a route table in a specified resource group. + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -867,9 +877,6 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The name of the route table. /// - /// - /// Parameters supplied to the create or update route table operation. - /// /// /// Headers that will be added to request. /// @@ -879,9 +886,6 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -891,7 +895,7 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -901,15 +905,11 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,10 +919,9 @@ internal RouteTablesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -942,7 +941,7 @@ internal RouteTablesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -973,12 +972,6 @@ internal RouteTablesOperations(NetworkManagementClient client) // 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) { @@ -999,7 +992,7 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1034,49 +1027,13 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = 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); @@ -1085,7 +1042,7 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// Updates a route table tags. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -1094,7 +1051,7 @@ internal RouteTablesOperations(NetworkManagementClient client) /// The name of the route table. /// /// - /// Parameters supplied to update route table tags. + /// Parameters supplied to the create or update route table operation. /// /// /// Headers that will be added to request. @@ -1117,7 +1074,7 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string routeTableName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1135,7 +1092,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1148,7 +1105,7 @@ internal RouteTablesOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1168,7 +1125,7 @@ internal RouteTablesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1225,7 +1182,7 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1285,6 +1242,24 @@ internal RouteTablesOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperationsExtensions.cs index 50a3adc6b454..f1244c1bc7a5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperationsExtensions.cs @@ -341,52 +341,6 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati } } - /// - /// Updates a route table tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to update route table tags. - /// - public static RouteTable BeginUpdateTags(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, routeTableName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a route table tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to update route table tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all route tables in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs index abb94bea3df9..8d0afbb944b7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs @@ -126,7 +126,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs index f235d3af0c30..c801654b30a9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs @@ -21,95 +21,97 @@ public static IEnumerable> ApiInfo_NetworkManageme { new Tuple("Compute", "NetworkInterfaces", "2018-10-01"), new Tuple("Compute", "PublicIPAddresses", "2018-10-01"), - new Tuple("Network", "ApplicationGateways", "2019-08-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2019-08-01"), - new Tuple("Network", "AvailableDelegations", "2019-08-01"), - new Tuple("Network", "AvailableEndpointServices", "2019-08-01"), - new Tuple("Network", "AvailablePrivateEndpointTypes", "2019-08-01"), - new Tuple("Network", "AvailableResourceGroupDelegations", "2019-08-01"), - new Tuple("Network", "AvailableServiceAliases", "2019-08-01"), - new Tuple("Network", "AzureFirewallFqdnTags", "2019-08-01"), - new Tuple("Network", "AzureFirewalls", "2019-08-01"), - new Tuple("Network", "BastionHosts", "2019-08-01"), - new Tuple("Network", "BgpServiceCommunities", "2019-08-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2019-08-01"), + new Tuple("Network", "ApplicationGateways", "2019-09-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2019-09-01"), + new Tuple("Network", "AvailableDelegations", "2019-09-01"), + new Tuple("Network", "AvailableEndpointServices", "2019-09-01"), + new Tuple("Network", "AvailablePrivateEndpointTypes", "2019-09-01"), + new Tuple("Network", "AvailableResourceGroupDelegations", "2019-09-01"), + new Tuple("Network", "AvailableServiceAliases", "2019-09-01"), + new Tuple("Network", "AzureFirewallFqdnTags", "2019-09-01"), + new Tuple("Network", "AzureFirewalls", "2019-09-01"), + new Tuple("Network", "BastionHosts", "2019-09-01"), + new Tuple("Network", "BgpServiceCommunities", "2019-09-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2019-09-01"), new Tuple("Network", "ConnectionMonitors", "2019-06-01"), - new Tuple("Network", "DdosCustomPolicies", "2019-08-01"), - new Tuple("Network", "DdosProtectionPlans", "2019-08-01"), - new Tuple("Network", "DefaultSecurityRules", "2019-08-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2019-08-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2019-08-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2019-08-01"), - new Tuple("Network", "ExpressRouteCircuits", "2019-08-01"), - new Tuple("Network", "ExpressRouteConnections", "2019-08-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2019-08-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2019-08-01"), - new Tuple("Network", "ExpressRouteGateways", "2019-08-01"), - new Tuple("Network", "ExpressRouteLinks", "2019-08-01"), - new Tuple("Network", "ExpressRoutePorts", "2019-08-01"), - new Tuple("Network", "ExpressRoutePortsLocations", "2019-08-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2019-08-01"), - new Tuple("Network", "FirewallPolicies", "2019-08-01"), - new Tuple("Network", "FirewallPolicyRuleGroups", "2019-08-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2019-08-01"), - new Tuple("Network", "InboundNatRules", "2019-08-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2019-08-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2019-08-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2019-08-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2019-08-01"), - new Tuple("Network", "LoadBalancerOutboundRules", "2019-08-01"), - new Tuple("Network", "LoadBalancerProbes", "2019-08-01"), - new Tuple("Network", "LoadBalancers", "2019-08-01"), - new Tuple("Network", "LocalNetworkGateways", "2019-08-01"), - new Tuple("Network", "NatGateways", "2019-08-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2019-08-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2019-08-01"), - new Tuple("Network", "NetworkInterfaceTapConfigurations", "2019-08-01"), - new Tuple("Network", "NetworkInterfaces", "2019-08-01"), - new Tuple("Network", "NetworkProfiles", "2019-08-01"), - new Tuple("Network", "NetworkSecurityGroups", "2019-08-01"), - new Tuple("Network", "NetworkWatchers", "2019-08-01"), - new Tuple("Network", "Operations", "2019-08-01"), - new Tuple("Network", "P2sVpnGateways", "2019-08-01"), - new Tuple("Network", "PacketCaptures", "2019-08-01"), - new Tuple("Network", "PeerExpressRouteCircuitConnections", "2019-08-01"), - new Tuple("Network", "PrivateEndpoints", "2019-08-01"), - new Tuple("Network", "PrivateLinkServices", "2019-08-01"), - new Tuple("Network", "PublicIPAddresses", "2019-08-01"), - new Tuple("Network", "PublicIPPrefixes", "2019-08-01"), - new Tuple("Network", "ResourceNavigationLinks", "2019-08-01"), - new Tuple("Network", "RouteFilterRules", "2019-08-01"), - new Tuple("Network", "RouteFilters", "2019-08-01"), - new Tuple("Network", "RouteTables", "2019-08-01"), - new Tuple("Network", "Routes", "2019-08-01"), - new Tuple("Network", "SecurityRules", "2019-08-01"), - new Tuple("Network", "ServiceAssociationLinks", "2019-08-01"), - new Tuple("Network", "ServiceEndpointPolicies", "2019-08-01"), - new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2019-08-01"), - new Tuple("Network", "ServiceTags", "2019-08-01"), - new Tuple("Network", "Subnets", "2019-08-01"), - new Tuple("Network", "SupportedSecurityProviders", "2019-08-01"), - new Tuple("Network", "Usages", "2019-08-01"), - new Tuple("Network", "VirtualHubs", "2019-08-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2019-08-01"), - new Tuple("Network", "VirtualNetworkGateways", "2019-08-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2019-08-01"), - new Tuple("Network", "VirtualNetworkTaps", "2019-08-01"), - new Tuple("Network", "VirtualNetworks", "2019-08-01"), - new Tuple("Network", "VirtualRouterPeerings", "2019-08-01"), - new Tuple("Network", "VirtualRouters", "2019-08-01"), - new Tuple("Network", "VirtualWans", "2019-08-01"), - new Tuple("Network", "VpnConnections", "2019-08-01"), - new Tuple("Network", "VpnGateways", "2019-08-01"), - new Tuple("Network", "VpnLinkConnections", "2019-08-01"), - new Tuple("Network", "VpnServerConfigurations", "2019-08-01"), - new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2019-08-01"), - new Tuple("Network", "VpnSiteLinkConnections", "2019-08-01"), - new Tuple("Network", "VpnSiteLinks", "2019-08-01"), - new Tuple("Network", "VpnSites", "2019-08-01"), - new Tuple("Network", "VpnSitesConfiguration", "2019-08-01"), - new Tuple("Network", "WebApplicationFirewallPolicies", "2019-08-01"), - new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2019-08-01"), + new Tuple("Network", "DdosCustomPolicies", "2019-09-01"), + new Tuple("Network", "DdosProtectionPlans", "2019-09-01"), + new Tuple("Network", "DefaultSecurityRules", "2019-09-01"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2019-09-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2019-09-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2019-09-01"), + new Tuple("Network", "ExpressRouteCircuits", "2019-09-01"), + new Tuple("Network", "ExpressRouteConnections", "2019-09-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2019-09-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2019-09-01"), + new Tuple("Network", "ExpressRouteGateways", "2019-09-01"), + new Tuple("Network", "ExpressRouteLinks", "2019-09-01"), + new Tuple("Network", "ExpressRoutePorts", "2019-09-01"), + new Tuple("Network", "ExpressRoutePortsLocations", "2019-09-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2019-09-01"), + new Tuple("Network", "FirewallPolicies", "2019-09-01"), + new Tuple("Network", "FirewallPolicyRuleGroups", "2019-09-01"), + new Tuple("Network", "HubVirtualNetworkConnections", "2019-09-01"), + new Tuple("Network", "InboundNatRules", "2019-09-01"), + new Tuple("Network", "IpGroups", "2019-09-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2019-09-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2019-09-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2019-09-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2019-09-01"), + new Tuple("Network", "LoadBalancerOutboundRules", "2019-09-01"), + new Tuple("Network", "LoadBalancerProbes", "2019-09-01"), + new Tuple("Network", "LoadBalancers", "2019-09-01"), + new Tuple("Network", "LocalNetworkGateways", "2019-09-01"), + new Tuple("Network", "NatGateways", "2019-09-01"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2019-09-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2019-09-01"), + new Tuple("Network", "NetworkInterfaceTapConfigurations", "2019-09-01"), + new Tuple("Network", "NetworkInterfaces", "2019-09-01"), + new Tuple("Network", "NetworkProfiles", "2019-09-01"), + new Tuple("Network", "NetworkSecurityGroups", "2019-09-01"), + new Tuple("Network", "NetworkWatchers", "2019-09-01"), + new Tuple("Network", "Operations", "2019-09-01"), + new Tuple("Network", "P2sVpnGateways", "2019-09-01"), + new Tuple("Network", "PacketCaptures", "2019-09-01"), + new Tuple("Network", "PeerExpressRouteCircuitConnections", "2019-09-01"), + new Tuple("Network", "PrivateEndpoints", "2019-09-01"), + new Tuple("Network", "PrivateLinkServices", "2019-09-01"), + new Tuple("Network", "PublicIPAddresses", "2019-09-01"), + new Tuple("Network", "PublicIPPrefixes", "2019-09-01"), + new Tuple("Network", "ResourceNavigationLinks", "2019-09-01"), + new Tuple("Network", "RouteFilterRules", "2019-09-01"), + new Tuple("Network", "RouteFilters", "2019-09-01"), + new Tuple("Network", "RouteTables", "2019-09-01"), + new Tuple("Network", "Routes", "2019-09-01"), + new Tuple("Network", "SecurityRules", "2019-09-01"), + new Tuple("Network", "ServiceAssociationLinks", "2019-09-01"), + new Tuple("Network", "ServiceEndpointPolicies", "2019-09-01"), + new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2019-09-01"), + new Tuple("Network", "ServiceTags", "2019-09-01"), + new Tuple("Network", "Subnets", "2019-09-01"), + new Tuple("Network", "SupportedSecurityProviders", "2019-09-01"), + new Tuple("Network", "Usages", "2019-09-01"), + new Tuple("Network", "VirtualHubRouteTableV2s", "2019-09-01"), + new Tuple("Network", "VirtualHubs", "2019-09-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2019-09-01"), + new Tuple("Network", "VirtualNetworkGateways", "2019-09-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2019-09-01"), + new Tuple("Network", "VirtualNetworkTaps", "2019-09-01"), + new Tuple("Network", "VirtualNetworks", "2019-09-01"), + new Tuple("Network", "VirtualRouterPeerings", "2019-09-01"), + new Tuple("Network", "VirtualRouters", "2019-09-01"), + new Tuple("Network", "VirtualWans", "2019-09-01"), + new Tuple("Network", "VpnConnections", "2019-09-01"), + new Tuple("Network", "VpnGateways", "2019-09-01"), + new Tuple("Network", "VpnLinkConnections", "2019-09-01"), + new Tuple("Network", "VpnServerConfigurations", "2019-09-01"), + new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2019-09-01"), + new Tuple("Network", "VpnSiteLinkConnections", "2019-09-01"), + new Tuple("Network", "VpnSiteLinks", "2019-09-01"), + new Tuple("Network", "VpnSites", "2019-09-01"), + new Tuple("Network", "VpnSitesConfiguration", "2019-09-01"), + new Tuple("Network", "WebApplicationFirewallPolicies", "2019-09-01"), + new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2019-09-01"), }.AsEnumerable(); } } @@ -119,7 +121,7 @@ public static IEnumerable> ApiInfo_NetworkManageme 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:\\Projects\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "be57615271c318b48a5d9a619878a18697378277"; + public static readonly String GithubCommidId = "6405fdd6023e04e54fb5c834c6f658ee10d59ca4"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs index aa82528eea20..d7022a8d2a44 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs @@ -126,7 +126,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs index e6485e907157..f52516d5402a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs @@ -101,7 +101,7 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs index 8ca08b5f7bff..5986c3519ada 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs @@ -119,7 +119,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -301,7 +301,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) } /// - /// Updates service Endpoint Policies. + /// Updates tags of a service endpoint policy. /// /// /// The name of the resource group. @@ -313,22 +313,6 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// 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. /// /// @@ -349,13 +333,25 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,13 +359,18 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { _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, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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(); + 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) @@ -383,7 +384,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -414,6 +415,12 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) // 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) { @@ -469,7 +476,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -482,7 +489,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -502,11 +509,8 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) } /// - /// Gets all service endpoint Policies in a resource group. + /// Gets all the service endpoint policies in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -528,17 +532,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,15 +546,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + 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/serviceEndpointPolicies").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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) @@ -687,14 +685,11 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) } /// - /// Deletes the specified service endpoint policy. + /// Gets all service endpoint Policies in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the service endpoint policy. - /// /// /// Headers that will be added to request. /// @@ -704,6 +699,9 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -713,21 +711,17 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// 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)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,16 +730,14 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) _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); + 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}").ToString(); + 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("{serviceEndpointPolicyName}", System.Uri.EscapeDataString(serviceEndpointPolicyName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -759,7 +751,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -810,7 +802,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -845,13 +837,31 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -860,7 +870,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) } /// - /// Creates or updates a service Endpoint Policies. + /// Deletes the specified service endpoint policy. /// /// /// The name of the resource group. @@ -868,10 +878,6 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// 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. /// @@ -881,9 +887,6 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -893,7 +896,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// 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)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -903,15 +906,11 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -921,10 +920,9 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) 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); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -944,7 +942,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -975,12 +973,6 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) // 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) { @@ -1001,7 +993,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1036,49 +1028,13 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1087,7 +1043,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) } /// - /// Updates service Endpoint Policies. + /// Creates or updates a service Endpoint Policies. /// /// /// The name of the resource group. @@ -1096,7 +1052,8 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// The name of the service endpoint policy. /// /// - /// Parameters supplied to update service endpoint policy tags. + /// Parameters supplied to the create or update service endpoint policy + /// operation. /// /// /// Headers that will be added to request. @@ -1119,7 +1076,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) /// /// 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)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceEndpointPolicyName, ServiceEndpointPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1137,7 +1094,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1150,7 +1107,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1170,7 +1127,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1227,7 +1184,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1287,6 +1244,24 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperationsExtensions.cs index 16dd0b0595a9..b90898aeb463 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperationsExtensions.cs @@ -153,7 +153,7 @@ public static ServiceEndpointPolicy CreateOrUpdate(this IServiceEndpointPolicies } /// - /// Updates service Endpoint Policies. + /// Updates tags of a service endpoint policy. /// /// /// The operations group for this extension method. @@ -167,13 +167,13 @@ public static ServiceEndpointPolicy CreateOrUpdate(this IServiceEndpointPolicies /// /// Parameters supplied to update service endpoint policy tags. /// - public static ServiceEndpointPolicy Update(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters) + public static ServiceEndpointPolicy UpdateTags(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters) { - return operations.UpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); + return operations.UpdateTagsAsync(resourceGroupName, serviceEndpointPolicyName, parameters).GetAwaiter().GetResult(); } /// - /// Updates service Endpoint Policies. + /// Updates tags of a service endpoint policy. /// /// /// The operations group for this extension method. @@ -190,9 +190,9 @@ public static ServiceEndpointPolicy Update(this IServiceEndpointPoliciesOperatio /// /// The cancellation token. /// - public static async Task UpdateAsync(this IServiceEndpointPoliciesOperations operations, string resourceGroupName, string serviceEndpointPolicyName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateTagsAsync(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)) + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, serviceEndpointPolicyName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -345,52 +345,6 @@ public static ServiceEndpointPolicy BeginCreateOrUpdate(this IServiceEndpointPol } } - /// - /// 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. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs index aa707814c2ca..15dbbe2a7369 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs @@ -127,7 +127,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -745,7 +745,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs index 1fb448c2806e..f03f2db3c1f2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs @@ -90,7 +90,7 @@ internal ServiceTagsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs index d8070537b035..fa9c266d471e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs @@ -129,7 +129,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -414,7 +414,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -612,7 +612,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -804,7 +804,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1036,7 +1036,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1232,7 +1232,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs index a67dd321d942..9cbcfc1decb2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs @@ -94,7 +94,7 @@ internal UsagesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs new file mode 100644 index 000000000000..965064059ada --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs @@ -0,0 +1,1081 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// VirtualHubRouteTableV2sOperations operations. + /// + internal partial class VirtualHubRouteTableV2sOperations : IServiceOperations, IVirtualHubRouteTableV2sOperations + { + /// + /// Initializes a new instance of the VirtualHubRouteTableV2sOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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 virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + } + if (routeTableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + string apiVersion = "2019-09-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("virtualHubName", virtualHubName); + tracingParameters.Add("routeTableName", routeTableName); + 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/virtualHubs/{virtualHubName}/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + } + string apiVersion = "2019-09-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("virtualHubName", virtualHubName); + 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/virtualHubs/{virtualHubName}/routeTables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); + 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 a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when 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 virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + } + if (routeTableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + if (virtualHubRouteTableV2Parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubRouteTableV2Parameters"); + } + string apiVersion = "2019-09-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("virtualHubName", virtualHubName); + tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("virtualHubRouteTableV2Parameters", virtualHubRouteTableV2Parameters); + 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/virtualHubs/{virtualHubName}/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + 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(virtualHubRouteTableV2Parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubRouteTableV2Parameters, 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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 == 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; + } + + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// 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 virtualHubName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + } + if (routeTableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + string apiVersion = "2019-09-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("virtualHubName", virtualHubName); + tracingParameters.Add("routeTableName", routeTableName); + 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/virtualHubs/{virtualHubName}/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs new file mode 100644 index 000000000000..303dafa2824d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VirtualHubRouteTableV2sOperations. + /// + public static partial class VirtualHubRouteTableV2sOperationsExtensions + { + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static VirtualHubRouteTableV2 Get(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + return operations.GetAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the details of a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + public static VirtualHubRouteTableV2 CreateOrUpdate(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static void Delete(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + operations.DeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + public static IPage List(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName) + { + return operations.ListAsync(resourceGroupName, virtualHubName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualHubName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + public static VirtualHubRouteTableV2 BeginCreateOrUpdate(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates + /// the existing VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// Parameters supplied to create or update VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, VirtualHubRouteTableV2 virtualHubRouteTableV2Parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + public static void BeginDelete(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName) + { + operations.BeginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a VirtualHubRouteTableV2. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name of the VirtualHubRouteTableV2. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The name of the VirtualHubRouteTableV2. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IVirtualHubRouteTableV2sOperations operations, string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, routeTableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IVirtualHubRouteTableV2sOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the details of all VirtualHubRouteTableV2s. + /// + /// + /// 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 IVirtualHubRouteTableV2sOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs index ddf7949372c2..26d39910e6cf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -283,47 +283,6 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// Parameters supplied to update VirtualHub tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a VirtualHub. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the VirtualHubs in a resource group. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// /// Headers that will be added to request. /// /// @@ -344,7 +303,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -354,7 +313,15 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (virtualHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); + } + if (virtualHubParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,15 +330,18 @@ internal VirtualHubsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("virtualHubParameters", virtualHubParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/virtualHubs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -384,7 +354,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -415,6 +385,12 @@ internal VirtualHubsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(virtualHubParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubParameters, 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) { @@ -470,7 +446,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -483,7 +459,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -503,8 +479,33 @@ internal VirtualHubsOperations(NetworkManagementClient client) } /// - /// Lists all the VirtualHubs in a subscription. + /// Deletes a VirtualHub. /// + /// + /// The resource group name of the VirtualHub. + /// + /// + /// The name of the VirtualHub. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualHubName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the VirtualHubs in a resource group. + /// + /// + /// The resource group name of the VirtualHub. + /// /// /// Headers that will be added to request. /// @@ -526,13 +527,17 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,14 +545,16 @@ internal VirtualHubsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/virtualHubs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -679,18 +686,8 @@ internal VirtualHubsOperations(NetworkManagementClient client) } /// - /// Creates a VirtualHub resource if it doesn't exist else updates the existing - /// VirtualHub. + /// Lists all the VirtualHubs in a subscription. /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to create or update VirtualHub. - /// /// /// Headers that will be added to request. /// @@ -712,25 +709,13 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualHubName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); - } - if (virtualHubParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,19 +723,14 @@ internal VirtualHubsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualHubName", virtualHubName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("virtualHubParameters", virtualHubParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/virtualHubs/{virtualHubName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualHubName}", System.Uri.EscapeDataString(virtualHubName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -763,7 +743,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -794,12 +774,6 @@ internal VirtualHubsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(virtualHubParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualHubParameters, 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) { @@ -820,7 +794,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -855,7 +829,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -868,25 +842,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -906,7 +862,8 @@ internal VirtualHubsOperations(NetworkManagementClient client) } /// - /// Updates VirtualHub tags. + /// Creates a VirtualHub resource if it doesn't exist else updates the existing + /// VirtualHub. /// /// /// The resource group name of the VirtualHub. @@ -915,7 +872,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// The name of the VirtualHub. /// /// - /// Parameters supplied to update VirtualHub tags. + /// Parameters supplied to create or update VirtualHub. /// /// /// Headers that will be added to request. @@ -938,7 +895,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualHubName, VirtualHub virtualHubParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -956,7 +913,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -969,7 +926,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("virtualHubParameters", virtualHubParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -989,7 +946,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1172,7 +1129,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperationsExtensions.cs index 0e9e6e091a1c..7483f4c79f8f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperationsExtensions.cs @@ -302,52 +302,6 @@ public static VirtualHub BeginCreateOrUpdate(this IVirtualHubsOperations operati } } - /// - /// Updates VirtualHub tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to update VirtualHub tags. - /// - public static VirtualHub BeginUpdateTags(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates VirtualHub tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualHub. - /// - /// - /// The name of the VirtualHub. - /// - /// - /// Parameters supplied to update VirtualHub tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVirtualHubsOperations operations, string resourceGroupName, string virtualHubName, TagsObject virtualHubParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualHubName, virtualHubParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a VirtualHub. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs index abb876919ae4..30b6e6a525d0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -121,7 +121,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -869,7 +869,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1085,7 +1085,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1268,7 +1268,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1484,7 +1484,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1718,7 +1718,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1924,7 +1924,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2129,7 +2129,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs index fde10fe149bb..dba2b793ff9a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs @@ -120,7 +120,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -893,7 +893,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1196,7 +1196,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1482,7 +1482,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1698,7 +1698,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1881,7 +1881,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2087,7 +2087,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2284,7 +2284,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2469,7 +2469,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2679,7 +2679,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2882,7 +2882,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3079,7 +3079,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3279,7 +3279,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3481,7 +3481,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3694,7 +3694,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3897,7 +3897,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4096,7 +4096,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4301,7 +4301,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4498,7 +4498,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs index e7a06d18f72e..950d9f876905 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs index 942f8e7c258e..81bb2b85b1f2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs @@ -116,7 +116,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -304,22 +304,6 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// Parameters supplied to update VirtualNetworkTap tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, tapName, tapParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all the VirtualNetworkTaps in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -340,13 +324,25 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (tapName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); + } + if (tapParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tapParameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,13 +350,18 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("tapName", tapName); + tracingParameters.Add("tapParameters", tapParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{tapName}", System.Uri.EscapeDataString(tapName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -374,7 +375,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -405,6 +406,12 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(tapParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tapParameters, 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) { @@ -460,7 +467,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -473,7 +480,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -495,9 +502,6 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// Gets all the VirtualNetworkTaps in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -519,17 +523,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,15 +537,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -678,14 +676,11 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) } /// - /// Deletes the specified virtual network tap. + /// Gets all the VirtualNetworkTaps in a subscription. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network tap. - /// /// /// Headers that will be added to request. /// @@ -695,6 +690,9 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -704,21 +702,17 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (tapName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -727,16 +721,14 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("tapName", tapName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + 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/virtualNetworkTaps/{tapName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{tapName}", System.Uri.EscapeDataString(tapName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -750,7 +742,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -801,7 +793,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -836,13 +828,31 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -851,7 +861,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) } /// - /// Creates or updates a Virtual Network Tap. + /// Deletes the specified virtual network tap. /// /// /// The name of the resource group. @@ -859,9 +869,6 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// The name of the virtual network tap. /// - /// - /// Parameters supplied to the create or update virtual network tap operation. - /// /// /// Headers that will be added to request. /// @@ -871,9 +878,6 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -883,7 +887,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string tapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -893,15 +897,11 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,10 +911,9 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("tapName", tapName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -934,7 +933,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -965,12 +964,6 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // 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) { @@ -991,7 +984,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1026,49 +1019,13 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (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); @@ -1077,16 +1034,16 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) } /// - /// Updates an VirtualNetworkTap tags. + /// Creates or updates a Virtual Network Tap. /// /// /// The name of the resource group. /// /// - /// The name of the tap. + /// The name of the virtual network tap. /// - /// - /// Parameters supplied to update VirtualNetworkTap tags. + /// + /// Parameters supplied to the create or update virtual network tap operation. /// /// /// Headers that will be added to request. @@ -1109,7 +1066,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string tapName, TagsObject tapParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string tapName, VirtualNetworkTap parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1119,15 +1076,15 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tapName"); } - if (tapParameters == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tapParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1137,10 +1094,10 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("tapName", tapName); - tracingParameters.Add("tapParameters", tapParameters); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1160,7 +1117,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1191,9 +1148,9 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(tapParameters != null) + if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tapParameters, Client.SerializationSettings); + _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"); } @@ -1217,7 +1174,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1277,6 +1234,24 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperationsExtensions.cs index 61cca277dd35..43f185ddb040 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperationsExtensions.cs @@ -335,52 +335,6 @@ public static VirtualNetworkTap BeginCreateOrUpdate(this IVirtualNetworkTapsOper } } - /// - /// Updates an VirtualNetworkTap tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the tap. - /// - /// - /// Parameters supplied to update VirtualNetworkTap tags. - /// - public static VirtualNetworkTap BeginUpdateTags(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, TagsObject tapParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, tapName, tapParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates an VirtualNetworkTap tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the tap. - /// - /// - /// Parameters supplied to update VirtualNetworkTap tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVirtualNetworkTapsOperations operations, string resourceGroupName, string tapName, TagsObject tapParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, tapName, tapParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all the VirtualNetworkTaps in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs index b50f5a5eaec9..764eb62cfe87 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs @@ -119,7 +119,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -312,22 +312,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// Parameters supplied to update virtual network tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all virtual networks in a subscription. - /// - /// /// Headers that will be added to request. /// /// @@ -348,13 +332,25 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,13 +358,18 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -382,7 +383,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -413,6 +414,12 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // 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) { @@ -468,7 +475,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -481,7 +488,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -501,11 +508,8 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Gets all virtual networks in a resource group. + /// Gets all virtual networks in a subscription. /// - /// - /// The name of the resource group. - /// /// /// Headers that will be added to request. /// @@ -527,17 +531,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -545,15 +545,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -686,17 +684,11 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Checks whether a private IP address is available for use. + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// The private IP address to be verified. - /// /// /// Headers that will be added to request. /// @@ -718,25 +710,17 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (ipAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAddress"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -745,23 +729,16 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("ipAddress", ipAddress); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); + 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/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (ipAddress != null) - { - _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -859,7 +836,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -872,7 +849,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -892,7 +869,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Lists usage stats. + /// Checks whether a private IP address is available for use. /// /// /// The name of the resource group. @@ -900,6 +877,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// The private IP address to be verified. + /// /// /// Headers that will be added to request. /// @@ -921,7 +901,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListUsageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -931,11 +911,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } + if (ipAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ipAddress"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -945,17 +929,22 @@ internal VirtualNetworksOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("ipAddress", ipAddress); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", 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/virtualNetworks/{virtualNetworkName}/usages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (ipAddress != null) + { + _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1053,7 +1042,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1066,7 +1055,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1086,7 +1075,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Deletes the specified virtual network. + /// Lists usage stats. /// /// /// The name of the resource group. @@ -1103,6 +1092,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1112,7 +1104,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListUsageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1126,7 +1118,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1138,11 +1130,11 @@ internal VirtualNetworksOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsage", 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/virtualNetworks/{virtualNetworkName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -1158,7 +1150,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1209,7 +1201,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1244,13 +1236,31 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (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); @@ -1259,7 +1269,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Creates or updates a virtual network in the specified resource group. + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -1267,9 +1277,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// - /// - /// Parameters supplied to the create or update virtual network operation. - /// /// /// Headers that will be added to request. /// @@ -1279,9 +1286,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1291,7 +1295,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1301,19 +1305,11 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1323,10 +1319,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1346,7 +1341,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1377,12 +1372,6 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // 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) { @@ -1403,7 +1392,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1438,49 +1427,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = 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); @@ -1489,7 +1442,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Updates a virtual network tags. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -1498,7 +1451,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// Parameters supplied to update virtual network tags. + /// Parameters supplied to the create or update virtual network operation. /// /// /// Headers that will be added to request. @@ -1521,7 +1474,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1535,11 +1488,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { 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 = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1552,7 +1509,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1572,7 +1529,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1629,7 +1586,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1689,6 +1646,24 @@ internal VirtualNetworksOperations(NetworkManagementClient client) 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); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperationsExtensions.cs index dbdce0c34a98..0403f27eb299 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperationsExtensions.cs @@ -427,52 +427,6 @@ public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations } } - /// - /// Updates a virtual network tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to update virtual network tags. - /// - public static VirtualNetwork BeginUpdateTags(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, TagsObject parameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a virtual network tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to update virtual network tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all virtual networks in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs index 23facc091b3f..78611f398187 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -273,218 +273,6 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) return _result; } - /// - /// Updates a Virtual Router Peering. - /// - /// - /// The resource group name of the Virtual Router Peering. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering being updated. - /// - /// - /// Parameters supplied to update Virtual Router Peering operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualRouterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); - } - if (peeringName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2019-08-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("virtualRouterName", virtualRouterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", 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/virtualRouters/{virtualRouterName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); - _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); - 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Creates or updates the specified Virtual Router Peering. /// @@ -558,7 +346,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -751,7 +539,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -943,7 +731,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperationsExtensions.cs index 8a82cbd9f3b7..e96ba96bcdfa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperationsExtensions.cs @@ -110,58 +110,6 @@ public static VirtualRouterPeering Get(this IVirtualRouterPeeringsOperations ope } } - /// - /// Updates a Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Router Peering. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering being updated. - /// - /// - /// Parameters supplied to update Virtual Router Peering operation. - /// - public static VirtualRouterPeering Update(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters) - { - return operations.UpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a Virtual Router Peering. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Router Peering. - /// - /// - /// The name of the Virtual Router. - /// - /// - /// The name of the Virtual Router Peering being updated. - /// - /// - /// Parameters supplied to update Virtual Router Peering operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualRouterPeeringsOperations operations, string resourceGroupName, string virtualRouterName, string peeringName, VirtualRouterPeering parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, peeringName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Creates or updates the specified Virtual Router Peering. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs index ac4888a8760c..c196eaffb59b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs @@ -119,7 +119,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -269,209 +269,6 @@ internal VirtualRoutersOperations(NetworkManagementClient client) return _result; } - /// - /// Updates a Virtual Router. - /// - /// - /// The resource group name of the Virtual Router. - /// - /// - /// The name of the Virtual Router being updated. - /// - /// - /// Parameters supplied to Update Virtual Router 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string virtualRouterName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualRouterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualRouterName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2019-08-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("virtualRouterName", virtualRouterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", 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/virtualRouters/{virtualRouterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualRouterName}", System.Uri.EscapeDataString(virtualRouterName)); - 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Creates or updates the specified Virtual Router. /// @@ -534,7 +331,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -707,7 +504,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -889,7 +686,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1071,7 +868,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperationsExtensions.cs index 0278a8ca61a3..cea3a1ff44f9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperationsExtensions.cs @@ -104,52 +104,6 @@ public static void Delete(this IVirtualRoutersOperations operations, string reso } } - /// - /// Updates a Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Router. - /// - /// - /// The name of the Virtual Router being updated. - /// - /// - /// Parameters supplied to Update Virtual Router Tags. - /// - public static VirtualRouter Update(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, TagsObject parameters) - { - return operations.UpdateAsync(resourceGroupName, virtualRouterName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a Virtual Router. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Router. - /// - /// - /// The name of the Virtual Router being updated. - /// - /// - /// Parameters supplied to Update Virtual Router Tags. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVirtualRoutersOperations operations, string resourceGroupName, string virtualRouterName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, virtualRouterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Creates or updates the specified Virtual Router. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs index b5429449e28d..0d554f78c692 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs @@ -94,7 +94,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -283,47 +283,6 @@ internal VirtualWansOperations(NetworkManagementClient client) /// Parameters supplied to Update VirtualWAN tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualWANName, wANParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a VirtualWAN. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being deleted. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the VirtualWANs in a resource group. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// /// Headers that will be added to request. /// /// @@ -344,7 +303,7 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -354,7 +313,15 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (virtualWANName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + } + if (wANParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,15 +330,18 @@ internal VirtualWansOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("wANParameters", wANParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/virtualWans").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{VirtualWANName}", System.Uri.EscapeDataString(virtualWANName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -384,7 +354,7 @@ internal VirtualWansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -415,6 +385,12 @@ internal VirtualWansOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(wANParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(wANParameters, 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) { @@ -470,7 +446,7 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -483,7 +459,7 @@ internal VirtualWansOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -503,8 +479,33 @@ internal VirtualWansOperations(NetworkManagementClient client) } /// - /// Lists all the VirtualWANs in a subscription. + /// Deletes a VirtualWAN. /// + /// + /// The resource group name of the VirtualWan. + /// + /// + /// The name of the VirtualWAN being deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualWANName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the VirtualWANs in a resource group. + /// + /// + /// The resource group name of the VirtualWan. + /// /// /// Headers that will be added to request. /// @@ -526,13 +527,17 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,14 +545,16 @@ internal VirtualWansOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/virtualWans").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -679,18 +686,8 @@ internal VirtualWansOperations(NetworkManagementClient client) } /// - /// Creates a VirtualWAN resource if it doesn't exist else updates the existing - /// VirtualWAN. + /// Lists all the VirtualWANs in a subscription. /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being created or updated. - /// - /// - /// Parameters supplied to create or update VirtualWAN. - /// /// /// Headers that will be added to request. /// @@ -712,25 +709,13 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualWANName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); - } - if (wANParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,19 +723,14 @@ internal VirtualWansOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualWANName", virtualWANName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("wANParameters", wANParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/virtualWans/{VirtualWANName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{VirtualWANName}", System.Uri.EscapeDataString(virtualWANName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -763,7 +743,7 @@ internal VirtualWansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -794,12 +774,6 @@ internal VirtualWansOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(wANParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(wANParameters, 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) { @@ -820,7 +794,7 @@ internal VirtualWansOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -855,7 +829,7 @@ internal VirtualWansOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -868,25 +842,7 @@ internal VirtualWansOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -906,16 +862,17 @@ internal VirtualWansOperations(NetworkManagementClient client) } /// - /// Updates a VirtualWAN tags. + /// Creates a VirtualWAN resource if it doesn't exist else updates the existing + /// VirtualWAN. /// /// /// The resource group name of the VirtualWan. /// /// - /// The name of the VirtualWAN being updated. + /// The name of the VirtualWAN being created or updated. /// /// - /// Parameters supplied to Update VirtualWAN tags. + /// Parameters supplied to create or update VirtualWAN. /// /// /// Headers that will be added to request. @@ -938,7 +895,7 @@ internal VirtualWansOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, TagsObject wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWAN wANParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -956,7 +913,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -969,7 +926,7 @@ internal VirtualWansOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("wANParameters", wANParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -989,7 +946,7 @@ internal VirtualWansOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1172,7 +1129,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs index fd8ae5851820..b4c15464c9c9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs @@ -302,52 +302,6 @@ public static VirtualWAN BeginCreateOrUpdate(this IVirtualWansOperations operati } } - /// - /// Updates a VirtualWAN tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being updated. - /// - /// - /// Parameters supplied to Update VirtualWAN tags. - /// - public static VirtualWAN BeginUpdateTags(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, TagsObject wANParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, virtualWANName, wANParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a VirtualWAN tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VirtualWan. - /// - /// - /// The name of the VirtualWAN being updated. - /// - /// - /// Parameters supplied to Update VirtualWAN tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVirtualWansOperations operations, string resourceGroupName, string virtualWANName, TagsObject wANParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, virtualWANName, wANParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a VirtualWAN. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs index 974522a3172e..2c4650c97f6a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs @@ -101,7 +101,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs index ee1913874fc6..bfd0e221f731 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -283,69 +283,6 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// Parameters supplied to update a virtual wan vpn gateway tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a virtual wan vpn gateway. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Resets the primary of the vpn gateway in the specified resource group. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the VpnGateways in a resource group. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// /// Headers that will be added to request. /// /// @@ -366,7 +303,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -376,7 +313,15 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (gatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); + } + if (vpnGatewayParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -385,15 +330,18 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnGatewayParameters", vpnGatewayParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/vpnGateways").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -406,7 +354,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -437,6 +385,12 @@ internal VpnGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(vpnGatewayParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnGatewayParameters, 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) { @@ -492,7 +446,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -505,7 +459,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -525,8 +479,55 @@ internal VpnGatewaysOperations(NetworkManagementClient client) } /// - /// Lists all the VpnGateways in a subscription. + /// Deletes a virtual wan vpn gateway. /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Resets the primary of the vpn gateway in the specified resource group. + /// + /// + /// The resource group name of the VpnGateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string gatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync(resourceGroupName, gatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the VpnGateways in a resource group. + /// + /// + /// The resource group name of the VpnGateway. + /// /// /// Headers that will be added to request. /// @@ -548,13 +549,17 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -562,14 +567,16 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/vpnGateways").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -701,18 +708,8 @@ internal VpnGatewaysOperations(NetworkManagementClient client) } /// - /// Creates a virtual wan vpn gateway if it doesn't exist else updates the - /// existing gateway. + /// Lists all the VpnGateways in a subscription. /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to create or Update a virtual wan vpn gateway. - /// /// /// Headers that will be added to request. /// @@ -734,25 +731,13 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (gatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); - } - if (vpnGatewayParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -760,19 +745,14 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("gatewayName", gatewayName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vpnGatewayParameters", vpnGatewayParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/vpnGateways/{gatewayName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{gatewayName}", System.Uri.EscapeDataString(gatewayName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -785,7 +765,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -816,12 +796,6 @@ internal VpnGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(vpnGatewayParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnGatewayParameters, 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) { @@ -842,7 +816,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -877,7 +851,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -890,25 +864,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -928,7 +884,8 @@ internal VpnGatewaysOperations(NetworkManagementClient client) } /// - /// Updates virtual wan vpn gateway tags. + /// Creates a virtual wan vpn gateway if it doesn't exist else updates the + /// existing gateway. /// /// /// The resource group name of the VpnGateway. @@ -937,7 +894,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// The name of the gateway. /// /// - /// Parameters supplied to update a virtual wan vpn gateway tags. + /// Parameters supplied to create or Update a virtual wan vpn gateway. /// /// /// Headers that will be added to request. @@ -960,7 +917,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string gatewayName, VpnGateway vpnGatewayParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -978,7 +935,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -991,7 +948,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vpnGatewayParameters", vpnGatewayParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1011,7 +968,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1194,7 +1151,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1370,7 +1327,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperationsExtensions.cs index 469daf39d45d..9f5a8746b35e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperationsExtensions.cs @@ -342,52 +342,6 @@ public static VpnGateway BeginCreateOrUpdate(this IVpnGatewaysOperations operati } } - /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway tags. - /// - public static VpnGateway BeginUpdateTags(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates virtual wan vpn gateway tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnGateway. - /// - /// - /// The name of the gateway. - /// - /// - /// Parameters supplied to update a virtual wan vpn gateway tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVpnGatewaysOperations operations, string resourceGroupName, string gatewayName, TagsObject vpnGatewayParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, gatewayName, vpnGatewayParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a virtual wan vpn gateway. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs index b892275eb875..95fcb13c8f2b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs @@ -102,7 +102,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs index 667e020ece19..c969fc247468 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs @@ -120,7 +120,7 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs index 40d345f72c03..a6e3cb5a9520 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -283,47 +283,6 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// Parameters supplied to update VpnServerConfiguration tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a VpnServerConfiguration. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being deleted. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the vpnServerConfigurations in a resource group. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// /// Headers that will be added to request. /// /// @@ -344,7 +303,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -354,7 +313,15 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (vpnServerConfigurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); + } + if (vpnServerConfigurationParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,15 +330,18 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnServerConfigurationParameters", vpnServerConfigurationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/vpnServerConfigurations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -384,7 +354,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -415,6 +385,12 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(vpnServerConfigurationParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationParameters, 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) { @@ -470,7 +446,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -483,7 +459,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -503,8 +479,33 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) } /// - /// Lists all the VpnServerConfigurations in a subscription. + /// Deletes a VpnServerConfiguration. /// + /// + /// The resource group name of the VpnServerConfiguration. + /// + /// + /// The name of the VpnServerConfiguration being deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the vpnServerConfigurations in a resource group. + /// + /// + /// The resource group name of the VpnServerConfiguration. + /// /// /// Headers that will be added to request. /// @@ -526,13 +527,17 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,14 +545,16 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/vpnServerConfigurations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -679,18 +686,8 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) } /// - /// Creates a VpnServerConfiguration resource if it doesn't exist else updates - /// the existing VpnServerConfiguration. + /// Lists all the VpnServerConfigurations in a subscription. /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being created or updated. - /// - /// - /// Parameters supplied to create or update VpnServerConfiguration. - /// /// /// Headers that will be added to request. /// @@ -712,25 +709,13 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (vpnServerConfigurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); - } - if (vpnServerConfigurationParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,19 +723,14 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("vpnServerConfigurationName", vpnServerConfigurationName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vpnServerConfigurationParameters", vpnServerConfigurationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/vpnServerConfigurations/{vpnServerConfigurationName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{vpnServerConfigurationName}", System.Uri.EscapeDataString(vpnServerConfigurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -763,7 +743,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -794,12 +774,6 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(vpnServerConfigurationParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnServerConfigurationParameters, 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) { @@ -820,7 +794,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -855,7 +829,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -868,25 +842,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -906,16 +862,17 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) } /// - /// Updates VpnServerConfiguration tags. + /// Creates a VpnServerConfiguration resource if it doesn't exist else updates + /// the existing VpnServerConfiguration. /// /// /// The resource group name of the VpnServerConfiguration. /// /// - /// The name of the VpnServerConfiguration being updated. + /// The name of the VpnServerConfiguration being created or updated. /// /// - /// Parameters supplied to update VpnServerConfiguration tags. + /// Parameters supplied to create or update VpnServerConfiguration. /// /// /// Headers that will be added to request. @@ -938,7 +895,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnServerConfigurationName, VpnServerConfiguration vpnServerConfigurationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -956,7 +913,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -969,7 +926,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vpnServerConfigurationParameters", vpnServerConfigurationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -989,7 +946,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1172,7 +1129,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperationsExtensions.cs index cf9be418d86a..19dacac02d10 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperationsExtensions.cs @@ -302,52 +302,6 @@ public static VpnServerConfiguration BeginCreateOrUpdate(this IVpnServerConfigur } } - /// - /// Updates VpnServerConfiguration tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being updated. - /// - /// - /// Parameters supplied to update VpnServerConfiguration tags. - /// - public static VpnServerConfiguration BeginUpdateTags(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates VpnServerConfiguration tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnServerConfiguration. - /// - /// - /// The name of the VpnServerConfiguration being updated. - /// - /// - /// Parameters supplied to update VpnServerConfiguration tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVpnServerConfigurationsOperations operations, string resourceGroupName, string vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a VpnServerConfiguration. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs index 7028177e9c2a..0d789f6314a3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs @@ -108,7 +108,7 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs index 51da9793854f..59fa98faf4b2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs @@ -101,7 +101,7 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteLinkName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +297,7 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs index 754d60c24ee2..3b3a5982d2d6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs @@ -131,7 +131,7 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs index 2648700502b2..b8b1f456f15a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs @@ -94,7 +94,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -283,47 +283,6 @@ internal VpnSitesOperations(NetworkManagementClient client) /// Parameters supplied to update VpnSite tags. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a VpnSite. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being deleted. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the vpnSites in a resource group. - /// - /// - /// The resource group name of the VpnSite. - /// - /// /// Headers that will be added to request. /// /// @@ -344,7 +303,7 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -354,7 +313,15 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2019-08-01"; + if (vpnSiteName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); + } + if (vpnSiteParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,15 +330,18 @@ internal VpnSitesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("vpnSiteParameters", vpnSiteParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", 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/vpnSites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -384,7 +354,7 @@ internal VpnSitesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -415,6 +385,12 @@ internal VpnSitesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(vpnSiteParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnSiteParameters, 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) { @@ -470,7 +446,7 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -483,7 +459,7 @@ internal VpnSitesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -503,8 +479,33 @@ internal VpnSitesOperations(NetworkManagementClient client) } /// - /// Lists all the VpnSites in a subscription. + /// Deletes a VpnSite. /// + /// + /// The resource group name of the VpnSite. + /// + /// + /// The name of the VpnSite being deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vpnSiteName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the vpnSites in a resource group. + /// + /// + /// The resource group name of the VpnSite. + /// /// /// Headers that will be added to request. /// @@ -526,13 +527,17 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,14 +545,16 @@ internal VpnSitesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/providers/Microsoft.Network/vpnSites").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -679,18 +686,8 @@ internal VpnSitesOperations(NetworkManagementClient client) } /// - /// Creates a VpnSite resource if it doesn't exist else updates the existing - /// VpnSite. + /// Lists all the VpnSites in a subscription. /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being created or updated. - /// - /// - /// Parameters supplied to create or update VpnSite. - /// /// /// Headers that will be added to request. /// @@ -712,25 +709,13 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (vpnSiteName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); - } - if (vpnSiteParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,19 +723,14 @@ internal VpnSitesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("vpnSiteName", vpnSiteName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vpnSiteParameters", vpnSiteParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + 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/vpnSites/{vpnSiteName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{vpnSiteName}", System.Uri.EscapeDataString(vpnSiteName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -763,7 +743,7 @@ internal VpnSitesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -794,12 +774,6 @@ internal VpnSitesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(vpnSiteParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnSiteParameters, 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) { @@ -820,7 +794,7 @@ internal VpnSitesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -855,7 +829,7 @@ internal VpnSitesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -868,25 +842,7 @@ internal VpnSitesOperations(NetworkManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -906,16 +862,17 @@ internal VpnSitesOperations(NetworkManagementClient client) } /// - /// Updates VpnSite tags. + /// Creates a VpnSite resource if it doesn't exist else updates the existing + /// VpnSite. /// /// /// The resource group name of the VpnSite. /// /// - /// The name of the VpnSite being updated. + /// The name of the VpnSite being created or updated. /// /// - /// Parameters supplied to update VpnSite tags. + /// Parameters supplied to create or update VpnSite. /// /// /// Headers that will be added to request. @@ -938,7 +895,7 @@ internal VpnSitesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vpnSiteName, VpnSite vpnSiteParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -956,7 +913,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -969,7 +926,7 @@ internal VpnSitesOperations(NetworkManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vpnSiteParameters", vpnSiteParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -989,7 +946,7 @@ internal VpnSitesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1172,7 +1129,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperationsExtensions.cs index e9cfddaa7b0b..6095241dfd50 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperationsExtensions.cs @@ -302,52 +302,6 @@ public static VpnSite BeginCreateOrUpdate(this IVpnSitesOperations operations, s } } - /// - /// Updates VpnSite tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being updated. - /// - /// - /// Parameters supplied to update VpnSite tags. - /// - public static VpnSite BeginUpdateTags(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters) - { - return operations.BeginUpdateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates VpnSite tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the VpnSite. - /// - /// - /// The name of the VpnSite being updated. - /// - /// - /// Parameters supplied to update VpnSite tags. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateTagsAsync(this IVpnSitesOperations operations, string resourceGroupName, string vpnSiteName, TagsObject vpnSiteParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes a VpnSite. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs index a01ae84aa82b..99f2666225c1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs @@ -87,7 +87,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -265,7 +265,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -462,7 +462,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -675,7 +675,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { parameters.Validate(); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +920,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-08-01"; + string apiVersion = "2019-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj index 6795e810217f..741a8230ad8b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj @@ -7,17 +7,24 @@ Microsoft.Azure.Management.Network Provides management capabilities for Network services. Microsoft.Azure.Management.Network - 19.16.0-preview + 19.17.0-preview Microsoft Azure Network management;Network;Network management; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Properties/AssemblyInfo.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Properties/AssemblyInfo.cs index 8109fc0df053..ae02a8b47424 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Properties/AssemblyInfo.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/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.5.0.0")] -[assembly: AssemblyFileVersion("19.16.0.0")] +[assembly: AssemblyFileVersion("19.17.0.0")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")]