diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..1697e158f3ee --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ActiveConnectivityConfigurationsOperations operations. + /// + internal partial class ActiveConnectivityConfigurationsOperations : IServiceOperations, IActiveConnectivityConfigurationsOperations + { + /// + /// Initializes a new instance of the ActiveConnectivityConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActiveConnectivityConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, object 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("parameters", parameters); + 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/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/ActiveConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..91b9e2648a5a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ActiveConnectivityConfigurationsOperations. + /// + public static partial class ActiveConnectivityConfigurationsOperationsExtensions + { + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + public static ActiveConnectivityConfigurationsListResult List(this IActiveConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, object parameters) + { + return operations.ListAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IActiveConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..d8fddcce5e64 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ActiveSecurityAdminRulesOperations operations. + /// + internal partial class ActiveSecurityAdminRulesOperations : IServiceOperations, IActiveSecurityAdminRulesOperations + { + /// + /// Initializes a new instance of the ActiveSecurityAdminRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActiveSecurityAdminRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, object 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("parameters", parameters); + 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/networkManagers/{networkManagerName}/listActiveSecurityAdminRules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/ActiveSecurityAdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs new file mode 100644 index 000000000000..75cb43b89d03 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ActiveSecurityAdminRulesOperations. + /// + public static partial class ActiveSecurityAdminRulesOperationsExtensions + { + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + public static ActiveSecurityAdminRulesListResult List(this IActiveSecurityAdminRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters) + { + return operations.ListAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IActiveSecurityAdminRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs new file mode 100644 index 000000000000..1c3dbeccddbe --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ActiveSecurityUserRulesOperations operations. + /// + internal partial class ActiveSecurityUserRulesOperations : IServiceOperations, IActiveSecurityUserRulesOperations + { + /// + /// Initializes a new instance of the ActiveSecurityUserRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActiveSecurityUserRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, object 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("parameters", parameters); + 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/networkManagers/{networkManagerName}/listActiveSecurityUserRules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/ActiveSecurityUserRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs new file mode 100644 index 000000000000..6c41e9f405aa --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ActiveSecurityUserRulesOperations. + /// + public static partial class ActiveSecurityUserRulesOperationsExtensions + { + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + public static ActiveSecurityUserRulesListResult List(this IActiveSecurityUserRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters) + { + return operations.ListAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IActiveSecurityUserRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs new file mode 100644 index 000000000000..ff6043978c5e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs @@ -0,0 +1,1107 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// AdminRuleCollectionsOperations operations. + /// + internal partial class AdminRuleCollectionsOperations : IServiceOperations, IAdminRuleCollectionsOperations + { + /// + /// Initializes a new instance of the AdminRuleCollectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AdminRuleCollectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a network manager security admin configuration rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, string ruleCollectionName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates an admin rule collection. + /// + /// + /// The Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ruleCollection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollection"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("ruleCollection", ruleCollection); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + 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(ruleCollection != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(ruleCollection, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an admin rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// 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/AdminRuleCollectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs new file mode 100644 index 000000000000..01e9248b091b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs @@ -0,0 +1,288 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 AdminRuleCollectionsOperations. + /// + public static partial class AdminRuleCollectionsOperationsExtensions + { + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a network manager security admin configuration rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static RuleCollection Get(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a network manager security admin configuration rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static RuleCollection CreateOrUpdate(this IAdminRuleCollectionsOperations operations, RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.CreateOrUpdateAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IAdminRuleCollectionsOperations operations, RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static void Delete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an admin rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IAdminRuleCollectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// 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 IAdminRuleCollectionsOperations 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/AdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs new file mode 100644 index 000000000000..22224af60f72 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs @@ -0,0 +1,1141 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// AdminRulesOperations operations. + /// + internal partial class AdminRulesOperations : IServiceOperations, IAdminRulesOperations + { + /// + /// Initializes a new instance of the AdminRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AdminRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, string ruleCollectionName, string ruleName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("ruleName", ruleName); + 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates an admin rule. + /// + /// + /// The admin rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (adminRule == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "adminRule"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("adminRule", adminRule); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + 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(adminRule != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(adminRule, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an admin rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// 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/AdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs new file mode 100644 index 000000000000..beb48f173673 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs @@ -0,0 +1,308 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 AdminRulesOperations. + /// + public static partial class AdminRulesOperationsExtensions + { + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static BaseAdminRule Get(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The admin rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static BaseAdminRule CreateOrUpdate(this IAdminRulesOperations operations, BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return operations.CreateOrUpdateAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The admin rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IAdminRulesOperations operations, BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static void Delete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an admin rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IAdminRulesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// 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 IAdminRulesOperations 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/ApplicationGatewayPrivateEndpointConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs index 9231b2695aa9..5eb5c1c1b475 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs @@ -155,7 +155,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,11 +738,15 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs index d91fd38afd31..c468b3b247a5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs @@ -94,7 +94,7 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 6b3c07439940..368c80ade2f8 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -991,7 +991,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1162,7 +1162,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1333,7 +1333,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1504,7 +1504,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1680,7 +1680,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1856,7 +1856,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2039,7 +2039,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2228,7 +2228,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2415,7 +2415,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2631,7 +2631,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2804,7 +2804,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2985,7 +2985,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3196,7 +3196,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "probeRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 ce389fc9c292..2454b8a63c24 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -530,7 +530,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -713,7 +713,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +902,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 8fa5ebfb12cd..abdee37b7ca8 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 = "2021-02-01"; + string apiVersion = "2020-11-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 fc745bd1d505..a4c8d494e1dc 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 = "2021-02-01"; + string apiVersion = "2020-11-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 f75b8657c46c..c35ff7911f3a 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 4b41933a1330..c219d401c918 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 = "2021-02-01"; + string apiVersion = "2020-11-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 93837be87e9e..fc50ac4b85ee 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 6c7a50e030fd..cbcb59123504 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 = "2021-02-01"; + string apiVersion = "2020-11-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 a928b7c36eeb..cc7eaada128f 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -718,7 +718,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -912,7 +912,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1138,7 +1138,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 103a014964f7..a78b59c78039 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 14c42a5366c2..b1fe12548e98 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs index f2a831709c5b..572bde4a13c5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs @@ -133,7 +133,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +363,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -636,7 +636,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -847,7 +847,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1072,7 +1072,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1249,7 +1249,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1426,7 +1426,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1606,7 +1606,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs similarity index 81% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs index 805b9943c103..08b672546e7d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// VirtualNetworkGatewayNatRulesOperations operations. + /// ConnectivityConfigurationsOperations operations. /// - internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperations, IVirtualNetworkGatewayNatRulesOperations + internal partial class ConnectivityConfigurationsOperations : IServiceOperations, IConnectivityConfigurationsOperations { /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRulesOperations class. + /// Initializes a new instance of the ConnectivityConfigurationsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) + internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { if (client == null) { @@ -51,16 +51,17 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Retrieves the details of a nat rule. + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// The name of the network manager. /// - /// - /// The name of the nat rule. + /// + /// The name of the network manager connectivity configuration. /// /// /// Headers that will be added to request. @@ -83,7 +84,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -93,15 +94,15 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); } - if (natRuleName == null) + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -109,20 +110,20 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); 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/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -221,7 +222,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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")) @@ -234,7 +235,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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) { @@ -254,67 +255,20 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. + /// Creates/Updates a new network manager connectivity configuration /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a nat rule. - /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// The name of the network manager. /// - /// - /// The name of the nat rule. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The resource group name of the virtual network gateway. - /// - /// - /// The name of the gateway. + /// + /// The name of the network manager connectivity configuration. /// /// /// Headers that will be added to request. @@ -337,8 +291,16 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (connectivityConfiguration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectivityConfiguration"); + } + if (connectivityConfiguration != null) + { + connectivityConfiguration.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -347,11 +309,15 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -359,18 +325,21 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("connectivityConfiguration", connectivityConfiguration); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -383,7 +352,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -414,6 +383,12 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(connectivityConfiguration != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectivityConfiguration, 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) { @@ -434,7 +409,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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 @@ -469,7 +444,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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 +457,25 @@ internal VirtualNetworkGatewayNatRulesOperations(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) + { + _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) { @@ -502,20 +495,17 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name /// /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. + /// The name of the resource group. /// - /// - /// The name of the nat rule. + /// + /// The name of the network manager. /// - /// - /// Parameters supplied to create or Update a Nat Rule. + /// + /// The name of the network manager connectivity configuration. /// /// /// Headers that will be added to request. @@ -526,9 +516,6 @@ internal VirtualNetworkGatewayNatRulesOperations(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 /// @@ -538,7 +525,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -548,19 +535,15 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); - } - if (natRuleName == null) + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); } - if (natRuleParameters == null) + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -568,21 +551,20 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("natRuleParameters", natRuleParameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -595,7 +577,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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) @@ -626,12 +608,6 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(natRuleParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(natRuleParameters, 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) { @@ -652,7 +628,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -687,49 +663,13 @@ internal VirtualNetworkGatewayNatRulesOperations(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); @@ -738,16 +678,24 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Deletes a nat rule. + /// Lists all the network manager connectivity configuration in a specified + /// network manager. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// The name of the network manager. /// - /// - /// The name of the nat rule. + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. /// /// /// Headers that will be added to request. @@ -758,6 +706,9 @@ internal VirtualNetworkGatewayNatRulesOperations(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 /// @@ -767,7 +718,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -777,15 +728,19 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); } - if (natRuleName == null) + if (top < 1) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -793,25 +748,33 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); 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/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -819,7 +782,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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) @@ -870,7 +833,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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 @@ -905,13 +868,31 @@ internal VirtualNetworkGatewayNatRulesOperations(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); @@ -920,7 +901,8 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Retrieves all nat rules for a particular virtual network gateway. + /// Lists all the network manager connectivity configuration in a specified + /// network manager. /// /// /// The NextLink from the previous successful call to List operation. @@ -946,7 +928,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -961,7 +943,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGatewayNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1060,7 +1042,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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")) @@ -1073,7 +1055,7 @@ internal VirtualNetworkGatewayNatRulesOperations(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) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..4985d5567c8e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs @@ -0,0 +1,270 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 ConnectivityConfigurationsOperations. + /// + public static partial class ConnectivityConfigurationsOperationsExtensions + { + /// + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + public static ConnectivityConfiguration Get(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates/Updates a new network manager connectivity configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + public static ConnectivityConfiguration CreateOrUpdate(this IConnectivityConfigurationsOperations operations, ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.CreateOrUpdateAsync(connectivityConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Creates/Updates a new network manager connectivity configuration + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IConnectivityConfigurationsOperations operations, ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(connectivityConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + public static void Delete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IConnectivityConfigurationsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// 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 IConnectivityConfigurationsOperations 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/CustomIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs index 03392f411211..1ba7a0b4636d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs @@ -119,7 +119,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,11 +1088,15 @@ internal CustomIPPrefixesOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-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 9356d78ad2e9..ccad956f2296 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,7 +540,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -723,7 +723,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 be558b5ab53f..8effd010c864 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1084,7 +1084,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 f1a2dc4fbc4f..7a44c31c1201 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs index 9873b6613755..042b8c3cf635 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs @@ -141,7 +141,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -328,7 +328,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -506,7 +506,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -703,7 +703,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +919,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..67f5629af998 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,263 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// EffectiveConnectivityConfigurationsOperations operations. + /// + internal partial class EffectiveConnectivityConfigurationsOperations : IServiceOperations, IEffectiveConnectivityConfigurationsOperations + { + /// + /// Initializes a new instance of the EffectiveConnectivityConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal EffectiveConnectivityConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 virtualNetworkName, object 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 (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + 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/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/EffectiveConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..8e0d53955d1e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 EffectiveConnectivityConfigurationsOperations. + /// + public static partial class EffectiveConnectivityConfigurationsOperationsExtensions + { + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + public static NetworkManagerEffectiveConnectivityConfigurationListResult List(this IEffectiveConnectivityConfigurationsOperations operations, string resourceGroupName, string virtualNetworkName, object parameters) + { + return operations.ListAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); + } + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IEffectiveConnectivityConfigurationsOperations operations, string resourceGroupName, string virtualNetworkName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs new file mode 100644 index 000000000000..0606b7d86ee9 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs @@ -0,0 +1,503 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// EffectiveVirtualNetworksOperations operations. + /// + internal partial class EffectiveVirtualNetworksOperations : IServiceOperations, IEffectiveVirtualNetworksOperations + { + /// + /// Initializes a new instance of the EffectiveVirtualNetworksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> ListByNetworkManagerWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), EffectiveVirtualNetworksParameter parameters = default(EffectiveVirtualNetworksParameter), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNetworkManager", 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/networkManagers/{networkManagerName}/listEffectiveVirtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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; + } + + /// + /// Lists all effective virtual networks by specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> ListByNetworkGroupWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNetworkGroup", 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/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/listEffectiveVirtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/EffectiveVirtualNetworksOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs new file mode 100644 index 000000000000..48df7084fb75 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs @@ -0,0 +1,143 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 EffectiveVirtualNetworksOperations. + /// + public static partial class EffectiveVirtualNetworksOperationsExtensions + { + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Effective Virtual Networks Parameter. + /// + public static EffectiveVirtualNetworksListResult ListByNetworkManager(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), EffectiveVirtualNetworksParameter parameters = default(EffectiveVirtualNetworksParameter)) + { + return operations.ListByNetworkManagerAsync(resourceGroupName, networkManagerName, top, skipToken, parameters).GetAwaiter().GetResult(); + } + + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListByNetworkManagerAsync(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), EffectiveVirtualNetworksParameter parameters = default(EffectiveVirtualNetworksParameter), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNetworkManagerWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all effective virtual networks by specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Parameters supplied to list correct page. + /// + public static EffectiveVirtualNetworksListResult ListByNetworkGroup(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters) + { + return operations.ListByNetworkGroupAsync(resourceGroupName, networkManagerName, networkGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists all effective virtual networks by specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The cancellation token. + /// + public static async Task ListByNetworkGroupAsync(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNetworkGroupWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 dad64a32f76d..727b5f00e5fc 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 e1e87c7ce4f9..8fd1e24b67e6 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 122b85ca4492..65618c5c3a84 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 c806cddcaef5..3ec95cf70b5d 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -631,7 +631,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -832,7 +832,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1021,7 +1021,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1199,7 +1199,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1386,7 +1386,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1570,7 +1570,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1804,7 +1804,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2017,7 +2017,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2230,7 +2230,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 25e7889593a3..3ea85853d7dd 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 5131c2b7d228..424a65d5311d 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 5a6a435b2d59..3e954d5166fe 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -681,7 +681,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -976,7 +976,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1192,7 +1192,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1405,7 +1405,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1618,7 +1618,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 2f86ea48dfc7..537dedbce767 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -734,7 +734,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -960,7 +960,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1160,7 +1160,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 6aeeda12d144..1f1298dc0741 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 6b3321f4b107..1c89b656f426 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 5ffc81a47db4..787248fedffc 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -916,7 +916,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1114,7 +1114,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1297,7 +1297,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 0a204582f11a..5fa49ce548c5 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 = "2021-02-01"; + string apiVersion = "2020-11-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 c6751fefe998..d0653512977d 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -336,7 +336,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -514,7 +514,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -701,7 +701,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -884,7 +884,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs index 18f24674b839..cf21a38eb076 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs @@ -126,7 +126,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs index 8dd83d5554c4..7cb8a17e5295 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs @@ -136,7 +136,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -341,7 +341,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -557,7 +557,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -764,7 +764,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -984,7 +984,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs index 83c9b20f1056..908cdbecf80a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs @@ -130,7 +130,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 3285c9afc8ef..e004b4b0ce74 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs @@ -155,7 +155,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "hubVirtualNetworkConnectionParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..359b182a5d4d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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; + + /// + /// ActiveConnectivityConfigurationsOperations operations. + /// + public partial interface IActiveConnectivityConfigurationsOperations + { + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// 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 networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..f335a3886261 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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; + + /// + /// ActiveSecurityAdminRulesOperations operations. + /// + public partial interface IActiveSecurityAdminRulesOperations + { + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// 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 networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs new file mode 100644 index 000000000000..da30dc26eb9c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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; + + /// + /// ActiveSecurityUserRulesOperations operations. + /// + public partial interface IActiveSecurityUserRulesOperations + { + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// 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 networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs new file mode 100644 index 000000000000..860ac9b22b48 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs @@ -0,0 +1,186 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// AdminRuleCollectionsOperations operations. + /// + public partial interface IAdminRuleCollectionsOperations + { + /// + /// Lists all the rule collections in a security admin configuration, + /// in a paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a network manager security admin configuration rule + /// collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an admin rule collection. + /// + /// + /// The Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// 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(RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an admin rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the rule collections in a security admin configuration, + /// in a paginated format. + /// + /// + /// 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/IAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs new file mode 100644 index 000000000000..5b4c575a6a0d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// AdminRulesOperations operations. + /// + public partial interface IAdminRulesOperations + { + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an admin rule. + /// + /// + /// The admin rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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(BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an admin rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network manager security configuration admin rules. + /// + /// + /// 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/IConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..238d0e1b8e7f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs @@ -0,0 +1,175 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ConnectivityConfigurationsOperations operations. + /// + public partial interface IConnectivityConfigurationsOperations + { + /// + /// Gets a Network Connectivity Configuration, specified by the + /// resource group, network manager name, and connectivity + /// Configuration name + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// 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 networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates/Updates a new network manager connectivity configuration + /// + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// 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(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager connectivity configuration, specified by + /// the resource group, network manager name, and connectivity + /// configuration name + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// 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 networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager connectivity configuration in a + /// specified network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager connectivity configuration in a + /// specified network manager. + /// + /// + /// 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/IEffectiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..05563dea56ff --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// EffectiveConnectivityConfigurationsOperations operations. + /// + public partial interface IEffectiveConnectivityConfigurationsOperations + { + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// 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 virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs new file mode 100644 index 000000000000..57246bb8afa6 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// EffectiveVirtualNetworksOperations operations. + /// + public partial interface IEffectiveVirtualNetworksOperations + { + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// 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> ListByNetworkManagerWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), EffectiveVirtualNetworksParameter parameters = default(EffectiveVirtualNetworksParameter), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all effective virtual networks by specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// 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> ListByNetworkGroupWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, 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 4c3e80785eb5..cdeff94f892d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs @@ -172,28 +172,6 @@ public partial interface ILoadBalancersOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// 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 SwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Deletes the specified load balancer. /// /// @@ -245,28 +223,6 @@ public partial interface ILoadBalancersOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// 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 BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest 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/INetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs new file mode 100644 index 000000000000..cfcf113ee4c4 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs @@ -0,0 +1,174 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkGroupsOperations operations. + /// + public partial interface INetworkGroupsOperations + { + /// + /// Gets the specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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 networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a network group. + /// + /// + /// Parameters supplied to the specify which network group need to + /// create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite + /// the current resource. Specify the last-seen ETag value to prevent + /// accidentally overwriting concurrent changes. + /// + /// + /// 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(NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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 networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the specified network group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs index 4345303d04c6..243c475cd8e8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs @@ -300,6 +300,101 @@ public partial interface INetworkManagementClient : System.IDisposable /// INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; } + /// + /// Gets the INetworkManagersOperations. + /// + INetworkManagersOperations NetworkManagers { get; } + + /// + /// Gets the INetworkManagerCommitsOperations. + /// + INetworkManagerCommitsOperations NetworkManagerCommits { get; } + + /// + /// Gets the INetworkManagerDeploymentStatusOperations. + /// + INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; } + + /// + /// Gets the IEffectiveVirtualNetworksOperations. + /// + IEffectiveVirtualNetworksOperations EffectiveVirtualNetworks { get; } + + /// + /// Gets the IActiveConnectivityConfigurationsOperations. + /// + IActiveConnectivityConfigurationsOperations ActiveConnectivityConfigurations { get; } + + /// + /// Gets the IActiveSecurityAdminRulesOperations. + /// + IActiveSecurityAdminRulesOperations ActiveSecurityAdminRules { get; } + + /// + /// Gets the IActiveSecurityUserRulesOperations. + /// + IActiveSecurityUserRulesOperations ActiveSecurityUserRules { get; } + + /// + /// Gets the IConnectivityConfigurationsOperations. + /// + IConnectivityConfigurationsOperations ConnectivityConfigurations { get; } + + /// + /// Gets the IEffectiveConnectivityConfigurationsOperations. + /// + IEffectiveConnectivityConfigurationsOperations EffectiveConnectivityConfigurations { get; } + + /// + /// Gets the INetworkManagerEffectiveSecurityAdminRulesOperations. + /// + INetworkManagerEffectiveSecurityAdminRulesOperations NetworkManagerEffectiveSecurityAdminRules { get; } + + /// + /// Gets the INetworkGroupsOperations. + /// + INetworkGroupsOperations NetworkGroups { get; } + + /// + /// Gets the ISecurityUserConfigurationsOperations. + /// + ISecurityUserConfigurationsOperations SecurityUserConfigurations { get; } + + /// + /// Gets the IUserRuleCollectionsOperations. + /// + IUserRuleCollectionsOperations UserRuleCollections { get; } + + /// + /// Gets the IUserRulesOperations. + /// + IUserRulesOperations UserRules { get; } + + /// + /// Gets the ISecurityAdminConfigurationsOperations. + /// + ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; } + + /// + /// Gets the IAdminRuleCollectionsOperations. + /// + IAdminRuleCollectionsOperations AdminRuleCollections { get; } + + /// + /// Gets the IAdminRulesOperations. + /// + IAdminRulesOperations AdminRules { get; } + + /// + /// Gets the INetworkSecurityPerimetersOperations. + /// + INetworkSecurityPerimetersOperations NetworkSecurityPerimeters { get; } + + /// + /// Gets the IPerimeterAssociableResourceTypesOperations. + /// + IPerimeterAssociableResourceTypesOperations PerimeterAssociableResourceTypes { get; } + /// /// Gets the INetworkProfilesOperations. /// @@ -480,11 +575,6 @@ public partial interface INetworkManagementClient : System.IDisposable /// ILocalNetworkGatewaysOperations LocalNetworkGateways { get; } - /// - /// Gets the IVirtualNetworkGatewayNatRulesOperations. - /// - IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; } - /// /// Gets the IVirtualNetworkTapsOperations. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs new file mode 100644 index 000000000000..98c04c5684ec --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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; + + /// + /// NetworkManagerCommitsOperations operations. + /// + public partial interface INetworkManagerCommitsOperations + { + /// + /// Post a Network Manager Commit. + /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs new file mode 100644 index 000000000000..a88ee70040aa --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NetworkManagerDeploymentStatusOperations operations. + /// + public partial interface INetworkManagerDeploymentStatusOperations + { + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// Parameters supplied to specify which Managed Network deployment + /// status is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..5e957d43d159 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NetworkManagerEffectiveSecurityAdminRulesOperations operations. + /// + public partial interface INetworkManagerEffectiveSecurityAdminRulesOperations + { + /// + /// List all effective security admin rules applied on a virtual + /// network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// 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 virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs new file mode 100644 index 000000000000..df3c60f9c203 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs @@ -0,0 +1,235 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkManagersOperations operations. + /// + public partial interface INetworkManagersOperations + { + /// + /// Gets the specified Network Manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Network Manager. + /// + /// + /// Parameters supplied to specify which network manager is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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(NetworkManager parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Patch a NetworkManager Tags. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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> PatchTagsWithHttpMessagesAsync(TagsObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network managers in a subscription. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List network managers in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network managers 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List network managers in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs similarity index 58% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs index cfe04ed49e72..c9aca3bb444e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs @@ -19,21 +19,18 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// VirtualNetworkGatewayNatRulesOperations operations. + /// NetworkSecurityPerimetersOperations operations. /// - public partial interface IVirtualNetworkGatewayNatRulesOperations + public partial interface INetworkSecurityPerimetersOperations { /// - /// Retrieves the details of a nat rule. + /// Gets the specified network security perimeter by the name. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The name of the network security perimeter. /// /// /// The headers that will be added to request. @@ -50,22 +47,19 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a nat rule to a scalable virtual network gateway if it - /// doesn't exist else updates the existing nat rules. + /// Creates or updates a Network Security Perimeter. /// - /// - /// The resource group name of the Virtual Network Gateway. + /// + /// Parameter supplied to create or update the network security + /// perimeter. /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The name of the resource group. /// - /// - /// Parameters supplied to create or Update a Nat Rule. + /// + /// The name of the network security perimeter. /// /// /// The headers that will be added to request. @@ -82,18 +76,15 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a nat rule. + /// Deletes a network security perimeter. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The name of the network security perimeter. /// /// /// The headers that will be added to request. @@ -107,15 +98,19 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieves all nat rules for a particular virtual network gateway. + /// List all network security perimeters in a subscription. /// - /// - /// The resource group name of the virtual network gateway. + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. /// - /// - /// The name of the gateway. + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -132,22 +127,22 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a nat rule to a scalable virtual network gateway if it - /// doesn't exist else updates the existing nat rules. + /// List network security perimeters in a resource group. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. /// /// /// The headers that will be added to request. @@ -164,18 +159,12 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a nat rule. + /// List all network security perimeters in a subscription. /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -186,12 +175,15 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieves all nat rules for a particular virtual network gateway. + /// List network security perimeters in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -211,6 +203,6 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs new file mode 100644 index 000000000000..65d326f86a25 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PerimeterAssociableResourceTypesOperations operations. + /// + public partial interface IPerimeterAssociableResourceTypesOperations + { + /// + /// Gets the list of resources that are onboarded with NSP. These + /// resources can be associated with a network security perimeter + /// + /// + /// The location of the where the association is present. + /// + /// + /// 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 location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPAddressesOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPAddressesOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs new file mode 100644 index 000000000000..7d3ac606c48c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs @@ -0,0 +1,170 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SecurityAdminConfigurationsOperations operations. + /// + public partial interface ISecurityAdminConfigurationsOperations + { + /// + /// Lists all the network manager security admin configurations in a + /// network manager, in a paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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 networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// The security admin configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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(SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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 networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager security admin configurations in a + /// network manager, in a paginated format. + /// + /// + /// 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/ISecurityUserConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs new file mode 100644 index 000000000000..1d2445133ddc --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs @@ -0,0 +1,170 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SecurityUserConfigurationsOperations operations. + /// + public partial interface ISecurityUserConfigurationsOperations + { + /// + /// Lists all the network manager security user configurations in a + /// network manager, in a paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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 networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The security user configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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(SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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 networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager security user configurations in a + /// network manager, in a paginated format. + /// + /// + /// 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/IUserRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs new file mode 100644 index 000000000000..9013ffe428b7 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs @@ -0,0 +1,185 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// UserRuleCollectionsOperations operations. + /// + public partial interface IUserRuleCollectionsOperations + { + /// + /// Lists all the user rule collections in a security configuration, in + /// a paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a network manager security user configuration rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a user rule collection. + /// + /// + /// The User Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// 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(RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a user rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the user rule collections in a security configuration, in + /// a paginated format. + /// + /// + /// 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/IUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs new file mode 100644 index 000000000000..ae01bd107ac5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// UserRulesOperations operations. + /// + public partial interface IUserRulesOperations + { + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skipToken parameter + /// that specifies a starting point to use for subsequent calls. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a user rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a user rule. + /// + /// + /// The user rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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(BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a user rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule + /// collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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 networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all user rules in a rule collection. + /// + /// + /// 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/IVirtualNetworkPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs index 7d4f2c17d1c0..30d8cf856f60 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs @@ -92,11 +92,6 @@ public partial interface IVirtualNetworkPeeringsOperations /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the - /// current address space on the remote vNet after it's updated. - /// Possible values include: 'true' - /// /// /// The headers that will be added to request. /// @@ -112,7 +107,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// @@ -179,11 +174,6 @@ public partial interface IVirtualNetworkPeeringsOperations /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the - /// current address space on the remote vNet after it's updated. - /// Possible values include: 'true' - /// /// /// The headers that will be added to request. /// @@ -199,7 +189,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWansOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWansOperations.cs 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 bb2fa1fa176a..af63e984b55e 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,11 +744,15 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleParameters"); } + if (inboundNatRuleParameters != null) + { + inboundNatRuleParameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs index 71359f43d975..c11fc6f5f661 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs @@ -140,7 +140,7 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs index 83c3bed9e92e..03bf9f74963b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs @@ -119,7 +119,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 index 05df39419e92..97f7c7a2feb1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs @@ -98,7 +98,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -324,7 +324,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -535,7 +535,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -708,7 +708,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -900,7 +900,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1111,7 +1111,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 53144ece0d39..929e3bd3aa1c 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 7d4ffb0dcc69..d68664f3bb76 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 ebe3076b390c..4f7b1bf8ad33 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 d2aa818ebc98..c318f6963400 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 = "2021-02-01"; + string apiVersion = "2020-11-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 be952c47a179..a0bf8e787632 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 881fb8037971..00c1cd53433c 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 82cee7df715b..ba393202a49b 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,28 +868,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) return _result; } - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task SwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Deletes the specified load balancer. /// @@ -931,7 +909,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1110,11 +1088,15 @@ internal LoadBalancersOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1289,184 +1271,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) return _result; } - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// 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 BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-02-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapPublicIpAddresses", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Gets all the load balancers in a subscription. /// 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 362dbdb0106b..9477a9b9d806 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs @@ -258,43 +258,6 @@ public static IPage List(this ILoadBalancersOperations operations, } } - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - public static void SwapPublicIpAddresses(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters) - { - operations.SwapPublicIpAddressesAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The cancellation token. - /// - public static async Task SwapPublicIpAddressesAsync(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.SwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Deletes the specified load balancer. /// @@ -378,43 +341,6 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope } } - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - public static void BeginSwapPublicIpAddresses(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters) - { - operations.BeginSwapPublicIpAddressesAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The cancellation token. - /// - public static async Task BeginSwapPublicIpAddressesAsync(this ILoadBalancersOperations operations, string location, LoadBalancerVipSwapRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// 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 a30a76866a18..2ef11e9f2f7b 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -357,7 +357,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -762,7 +762,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -985,7 +985,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs new file mode 100644 index 000000000000..d08982310a28 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network base admin rule. + /// + public partial class ActiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the ActiveBaseSecurityAdminRule + /// class. + /// + public ActiveBaseSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveBaseSecurityAdminRule + /// class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + public ActiveBaseSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + CommitTime = commitTime; + Region = region; + ConfigurationDisplayName = configurationDisplayName; + ConfigurationDescription = configurationDescription; + RuleCollectionDisplayName = ruleCollectionDisplayName; + RuleCollectionDescription = ruleCollectionDescription; + RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + RuleGroups = ruleGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets deployment time string. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets deployment region. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets a display name of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; set; } + + /// + /// Gets or sets a description of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { get; set; } + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDisplayName")] + public string RuleCollectionDisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription { get; set; } + + /// + /// Gets or sets groups for rule collection + /// + [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public IList RuleCollectionAppliesToGroups { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "ruleGroups")] + public IList RuleGroups { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs new file mode 100644 index 000000000000..aae11068350f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs @@ -0,0 +1,122 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network base rule. + /// + public partial class ActiveBaseSecurityUserRule + { + /// + /// Initializes a new instance of the ActiveBaseSecurityUserRule class. + /// + public ActiveBaseSecurityUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveBaseSecurityUserRule class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security user configuration. + /// A description of the + /// security user configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + public ActiveBaseSecurityUserRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + CommitTime = commitTime; + Region = region; + ConfigurationDisplayName = configurationDisplayName; + ConfigurationDescription = configurationDescription; + RuleCollectionDisplayName = ruleCollectionDisplayName; + RuleCollectionDescription = ruleCollectionDescription; + RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + RuleGroups = ruleGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets deployment time string. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets deployment region. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets a display name of the security user configuration. + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; set; } + + /// + /// Gets or sets a description of the security user configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { get; set; } + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDisplayName")] + public string RuleCollectionDisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription { get; set; } + + /// + /// Gets or sets groups for rule collection + /// + [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public IList RuleCollectionAppliesToGroups { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "ruleGroups")] + public IList RuleGroups { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs new file mode 100644 index 000000000000..7d10df745948 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Effective Virtual Networks Parameter. + /// + public partial class ActiveConfigurationParameter + { + /// + /// Initializes a new instance of the ActiveConfigurationParameter + /// class. + /// + public ActiveConfigurationParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveConfigurationParameter + /// class. + /// + /// List of regions. + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public ActiveConfigurationParameter(IList regions = default(IList), string skipToken = default(string)) + { + Regions = regions; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of regions. + /// + [JsonProperty(PropertyName = "regions")] + public IList Regions { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs new file mode 100644 index 000000000000..3b36e75eba27 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Active connectivity configuration. + /// + public partial class ActiveConnectivityConfiguration : EffectiveConnectivityConfiguration + { + /// + /// Initializes a new instance of the ActiveConnectivityConfiguration + /// class. + /// + public ActiveConnectivityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveConnectivityConfiguration + /// class. + /// + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + /// Resource ID. + /// A friendly name for the resource. + /// A description of the connectivity + /// configuration. + /// The hub vnet Id. + /// Flag if global mesh is supported. Possible + /// values include: 'False', 'True' + /// Groups for configuration + /// The provisioning state of the + /// connectivity configuration resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Flag if need to remove current + /// existing peerings. Possible values include: 'False', 'True' + /// Effective configuration + /// groups. + /// Deployment time string. + /// Deployment region. + public ActiveConnectivityConfiguration(string connectivityTopology, string id = default(string), string displayName = default(string), string description = default(string), string hubId = default(string), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList), System.DateTime? commitTime = default(System.DateTime?), string region = default(string)) + : base(connectivityTopology, id, displayName, description, hubId, isGlobal, appliesToGroups, provisioningState, deleteExistingPeering, configurationGroups) + { + CommitTime = commitTime; + Region = region; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets deployment time string. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets deployment region. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs new file mode 100644 index 000000000000..b1695f4ce2a0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list active connectivity configurations. It + /// contains a list of active connectivity configurations and a skiptoken + /// to get the next set of results. + /// + public partial class ActiveConnectivityConfigurationsListResult + { + /// + /// Initializes a new instance of the + /// ActiveConnectivityConfigurationsListResult class. + /// + public ActiveConnectivityConfigurationsListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ActiveConnectivityConfigurationsListResult class. + /// + /// Gets a page of active connectivity + /// configurations. + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public ActiveConnectivityConfigurationsListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of active connectivity configurations. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs new file mode 100644 index 000000000000..c3aafcd2dfe2 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs @@ -0,0 +1,183 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network default admin rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class ActiveDefaultSecurityAdminRule : ActiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the ActiveDefaultSecurityAdminRule + /// class. + /// + public ActiveDefaultSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveDefaultSecurityAdminRule + /// class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// Default rule flag. + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// Indicates the access allowed for this + /// particular rule. Possible values include: 'Allow', 'Deny', + /// 'AlwaysAllow' + /// The priority of the rule. The value can be + /// between 1 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public ActiveDefaultSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets or sets default rule flag. + /// + [JsonProperty(PropertyName = "properties.flag")] + public string Flag { get; set; } + + /// + /// Gets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; private set; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// Gets indicates the access allowed for this particular rule. + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [JsonProperty(PropertyName = "properties.access")] + public string Access { get; private set; } + + /// + /// Gets the priority of the rule. The value can be between 1 and 4096. + /// The priority number must be unique for each rule in the collection. + /// The lower the priority number, the higher the priority of the rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int? Priority { get; private set; } + + /// + /// Gets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs new file mode 100644 index 000000000000..3d6b60ab2c19 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs @@ -0,0 +1,160 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network security default user rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class ActiveDefaultSecurityUserRule : ActiveBaseSecurityUserRule + { + /// + /// Initializes a new instance of the ActiveDefaultSecurityUserRule + /// class. + /// + public ActiveDefaultSecurityUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveDefaultSecurityUserRule + /// class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security user configuration. + /// A description of the + /// security user configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// Default rule flag. + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ActiveDefaultSecurityUserRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string direction = default(string), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets or sets default rule flag. + /// + [JsonProperty(PropertyName = "properties.flag")] + public string Flag { get; set; } + + /// + /// Gets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; private set; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// Gets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; private set; } + + /// + /// Gets the provisioning state of the security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs new file mode 100644 index 000000000000..17c1eb47ef76 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs @@ -0,0 +1,203 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network admin rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class ActiveSecurityAdminRule : ActiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the ActiveSecurityAdminRule class. + /// + public ActiveSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveSecurityAdminRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// Indicates the access allowed for this + /// particular rule. Possible values include: 'Allow', 'Deny', + /// 'AlwaysAllow' + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// The priority of the rule. The value can be + /// between 1 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public ActiveSecurityAdminRule(string protocol, string access, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// Gets or sets indicates the access allowed for this particular rule. + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [JsonProperty(PropertyName = "properties.access")] + public string Access { get; set; } + + /// + /// Gets or sets the priority of the rule. The value can be between 1 + /// and 4096. The priority number must be unique for each rule in the + /// collection. The lower the priority number, the higher the priority + /// of the rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int? Priority { get; set; } + + /// + /// Gets or sets indicates if the traffic matched against the rule in + /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Access == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Access"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + if (Priority > 4096) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (Priority < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs new file mode 100644 index 000000000000..9b841fa15b64 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list active security admin rules. It contains + /// a list of active security admin rules and a skiptoken to get the next + /// set of results. + /// + public partial class ActiveSecurityAdminRulesListResult + { + /// + /// Initializes a new instance of the + /// ActiveSecurityAdminRulesListResult class. + /// + public ActiveSecurityAdminRulesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ActiveSecurityAdminRulesListResult class. + /// + /// Gets a page of active security admin + /// rules. + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public ActiveSecurityAdminRulesListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of active security admin rules. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs new file mode 100644 index 000000000000..c13c74801328 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs @@ -0,0 +1,166 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network security user rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class ActiveSecurityUserRule : ActiveBaseSecurityUserRule + { + /// + /// Initializes a new instance of the ActiveSecurityUserRule class. + /// + public ActiveSecurityUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveSecurityUserRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security user configuration. + /// A description of the + /// security user configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// The provisioning state of the + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ActiveSecurityUserRule(string protocol, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// Gets or sets indicates if the traffic matched against the rule in + /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; set; } + + /// + /// Gets the provisioning state of the security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs new file mode 100644 index 000000000000..2b70be4dec52 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list active security user rules. It contains a + /// list of active security user rules and a skiptoken to get the next set + /// of results. + /// + public partial class ActiveSecurityUserRulesListResult + { + /// + /// Initializes a new instance of the ActiveSecurityUserRulesListResult + /// class. + /// + public ActiveSecurityUserRulesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveSecurityUserRulesListResult + /// class. + /// + /// Gets a page of active security user + /// rules. + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public ActiveSecurityUserRulesListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of active security user rules. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs new file mode 100644 index 000000000000..1874f1867c22 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Address prefix item. + /// + public partial class AddressPrefixItem + { + /// + /// Initializes a new instance of the AddressPrefixItem class. + /// + public AddressPrefixItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressPrefixItem class. + /// + /// Address prefix. + /// Address prefix type. Possible + /// values include: 'IPPrefix', 'ServiceTag' + public AddressPrefixItem(string addressPrefix = default(string), string addressPrefixType = default(string)) + { + AddressPrefix = addressPrefix; + AddressPrefixType = addressPrefixType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets address prefix. + /// + [JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix { get; set; } + + /// + /// Gets or sets address prefix type. Possible values include: + /// 'IPPrefix', 'ServiceTag' + /// + [JsonProperty(PropertyName = "addressPrefixType")] + public string AddressPrefixType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs new file mode 100644 index 000000000000..c094c49264ca --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for AddressPrefixType. + /// + public static class AddressPrefixType + { + public const string IPPrefix = "IPPrefix"; + public const string ServiceTag = "ServiceTag"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs new file mode 100644 index 000000000000..767e9a566aff --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network admin rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class AdminRule : BaseAdminRule + { + /// + /// Initializes a new instance of the AdminRule class. + /// + public AdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// Indicates the access allowed for this + /// particular rule. Possible values include: 'Allow', 'Deny', + /// 'AlwaysAllow' + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// The priority of the rule. The value can be + /// between 1 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public AdminRule(string protocol, string access, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// Gets or sets indicates the access allowed for this particular rule. + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [JsonProperty(PropertyName = "properties.access")] + public string Access { get; set; } + + /// + /// Gets or sets the priority of the rule. The value can be between 1 + /// and 4096. The priority number must be unique for each rule in the + /// collection. The lower the priority number, the higher the priority + /// of the rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int? Priority { get; set; } + + /// + /// Gets or sets indicates if the traffic matched against the rule in + /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Access == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Access"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + if (Priority > 4096) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (Priority < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + } +} 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 94a7a423c1fb..24bcc49fc4af 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 @@ -455,6 +455,16 @@ public virtual void Validate() { AutoscaleConfiguration.Validate(); } + if (PrivateEndpointConnections != null) + { + foreach (var element3 in PrivateEndpointConnections) + { + if (element3 != null) + { + element3.Validate(); + } + } + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index f031eeef3a70..c2a9bdc553d5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -75,6 +75,16 @@ public virtual void Validate() { BackendHttpSettings.Validate(); } + if (Servers != null) + { + foreach (var element in Servers) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 46b8ad150f46..2caf05181f53 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -76,5 +76,18 @@ public ApplicationGatewayBackendHealthServer() [JsonProperty(PropertyName = "healthProbeLog")] public string HealthProbeLog { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IpConfiguration != null) + { + IpConfiguration.Validate(); + } + } } } 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 similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs 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 similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs index 4d0fe00919cd..83d8747fdb4a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs @@ -115,5 +115,18 @@ public ApplicationGatewayPrivateEndpointConnection() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateEndpoint != null) + { + PrivateEndpoint.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs index 96ca38c8ca16..070e44985228 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs @@ -36,9 +36,6 @@ public ApplicationGatewayTrustedClientCertificate() /// /// Resource ID. /// Certificate public data. - /// Validated certificate data. - /// Distinguished name of client - /// certificate issuer. /// The provisioning state of the /// trusted client certificate resource. Possible values include: /// 'Succeeded', 'Updating', 'Deleting', 'Failed' @@ -47,12 +44,10 @@ public ApplicationGatewayTrustedClientCertificate() /// A unique read-only string that changes whenever /// the resource is updated. /// Type of the resource. - public ApplicationGatewayTrustedClientCertificate(string id = default(string), string data = default(string), string validatedCertData = default(string), string clientCertIssuerDN = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public ApplicationGatewayTrustedClientCertificate(string id = default(string), string data = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { Data = data; - ValidatedCertData = validatedCertData; - ClientCertIssuerDN = clientCertIssuerDN; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -71,18 +66,6 @@ public ApplicationGatewayTrustedClientCertificate() [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } - /// - /// Gets validated certificate data. - /// - [JsonProperty(PropertyName = "properties.validatedCertData")] - public string ValidatedCertData { get; private set; } - - /// - /// Gets distinguished name of client certificate issuer. - /// - [JsonProperty(PropertyName = "properties.clientCertIssuerDN")] - public string ClientCertIssuerDN { get; private set; } - /// /// Gets the provisioning state of the trusted client certificate /// resource. Possible values include: 'Succeeded', 'Updating', 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 0cb46bba66e0..e944c6b349d3 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 @@ -37,8 +37,6 @@ public BackendAddressPool() /// Resource ID. /// The location of the backend address /// pool. - /// An array of gateway load balancer - /// tunnel interfaces. /// An array of backend /// addresses. /// An array of references to IP @@ -58,11 +56,10 @@ public BackendAddressPool() /// A unique read-only string that changes whenever /// the resource is updated. /// Type of the resource. - public BackendAddressPool(string id = default(string), string location = default(string), IList tunnelInterfaces = default(IList), IList loadBalancerBackendAddresses = default(IList), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundRule = default(SubResource), IList outboundRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public BackendAddressPool(string id = default(string), string location = default(string), IList loadBalancerBackendAddresses = default(IList), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundRule = default(SubResource), IList outboundRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { Location = location; - TunnelInterfaces = tunnelInterfaces; LoadBalancerBackendAddresses = loadBalancerBackendAddresses; BackendIPConfigurations = backendIPConfigurations; LoadBalancingRules = loadBalancingRules; @@ -86,12 +83,6 @@ public BackendAddressPool() [JsonProperty(PropertyName = "properties.location")] public string Location { get; set; } - /// - /// Gets or sets an array of gateway load balancer tunnel interfaces. - /// - [JsonProperty(PropertyName = "properties.tunnelInterfaces")] - public IList TunnelInterfaces { get; set; } - /// /// Gets or sets an array of backend addresses. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs new file mode 100644 index 000000000000..f756c6fdbc86 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Network base admin rule. + /// + public partial class BaseAdminRule : ProxyResource + { + /// + /// Initializes a new instance of the BaseAdminRule class. + /// + public BaseAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BaseAdminRule class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + public BaseAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs new file mode 100644 index 000000000000..981cfe80403a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Network base rule. + /// + public partial class BaseUserRule : ProxyResource + { + /// + /// Initializes a new instance of the BaseUserRule class. + /// + public BaseUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BaseUserRule class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + public BaseUserRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} 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 414ddeaa1860..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 @@ -48,15 +48,13 @@ public BastionHost() /// 'Updating', 'Deleting', 'Failed' /// A unique read-only string that changes whenever /// the resource is updated. - /// The sku of this Bastion Host. - public BastionHost(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList ipConfigurations = default(IList), string dnsName = default(string), string provisioningState = default(string), string etag = default(string), Sku sku = default(Sku)) + public BastionHost(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList ipConfigurations = default(IList), string dnsName = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { IpConfigurations = ipConfigurations; DnsName = dnsName; ProvisioningState = provisioningState; Etag = etag; - Sku = sku; CustomInit(); } @@ -92,11 +90,5 @@ public BastionHost() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Gets or sets the sku of this Bastion Host. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs new file mode 100644 index 000000000000..6b33a126ed32 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 network configuration group resource + /// + [Rest.Serialization.JsonTransformation] + public partial class ConfigurationGroup + { + /// + /// Initializes a new instance of the ConfigurationGroup class. + /// + public ConfigurationGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationGroup class. + /// + /// Resource ID. + /// A friendly name for the network + /// group. + /// A description of the network + /// group. + /// Group member type. Possible values + /// include: 'VirtualNetwork', 'Subnet' + /// Group members of network group. + /// Network group conditional + /// filter. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + public ConfigurationGroup(string id = default(string), string displayName = default(string), string description = default(string), string memberType = default(string), IList groupMembers = default(IList), string conditionalMembership = default(string), string provisioningState = default(string)) + { + Id = id; + DisplayName = displayName; + Description = description; + MemberType = memberType; + GroupMembers = groupMembers; + ConditionalMembership = conditionalMembership; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a friendly name for the network group. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network group. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets group member type. Possible values include: + /// 'VirtualNetwork', 'Subnet' + /// + [JsonProperty(PropertyName = "properties.memberType")] + public string MemberType { get; set; } + + /// + /// Gets or sets group members of network group. + /// + [JsonProperty(PropertyName = "properties.groupMembers")] + public IList GroupMembers { get; set; } + + /// + /// Gets or sets network group conditional filter. + /// + [JsonProperty(PropertyName = "properties.conditionalMembership")] + public string ConditionalMembership { get; set; } + + /// + /// Gets the provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs new file mode 100644 index 000000000000..b98b4fb4e3a4 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for ConfigurationType. + /// + public static class ConfigurationType + { + public const string SecurityAdmin = "SecurityAdmin"; + public const string SecurityUser = "SecurityUser"; + public const string Connectivity = "Connectivity"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs new file mode 100644 index 000000000000..9a8fda920ab0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs @@ -0,0 +1,151 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 network manager connectivity configuration resource + /// + [Rest.Serialization.JsonTransformation] + public partial class ConnectivityConfiguration : ProxyResource + { + /// + /// Initializes a new instance of the ConnectivityConfiguration class. + /// + public ConnectivityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectivityConfiguration class. + /// + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A friendly name for the resource. + /// A description of the connectivity + /// configuration. + /// The hub vnet Id. + /// Flag if global mesh is supported. Possible + /// values include: 'False', 'True' + /// Groups for configuration + /// The provisioning state of the + /// connectivity configuration resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Flag if need to remove current + /// existing peerings. Possible values include: 'False', 'True' + /// The system metadata related to this + /// resource. + public ConnectivityConfiguration(string connectivityTopology, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), string hubId = default(string), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + ConnectivityTopology = connectivityTopology; + HubId = hubId; + IsGlobal = isGlobal; + AppliesToGroups = appliesToGroups; + ProvisioningState = provisioningState; + DeleteExistingPeering = deleteExistingPeering; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the resource. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the connectivity configuration. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets connectivity topology type. Possible values include: + /// 'HubAndSpoke', 'Mesh' + /// + [JsonProperty(PropertyName = "properties.connectivityTopology")] + public string ConnectivityTopology { get; set; } + + /// + /// Gets or sets the hub vnet Id. + /// + [JsonProperty(PropertyName = "properties.hubId")] + public string HubId { get; set; } + + /// + /// Gets or sets flag if global mesh is supported. Possible values + /// include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.isGlobal")] + public string IsGlobal { get; set; } + + /// + /// Gets or sets groups for configuration + /// + [JsonProperty(PropertyName = "properties.appliesToGroups")] + public IList AppliesToGroups { get; set; } + + /// + /// Gets the provisioning state of the connectivity configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.deleteExistingPeering")] + public string DeleteExistingPeering { get; set; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConnectivityTopology == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs new file mode 100644 index 000000000000..e1f52c22535c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ConnectivityGroupItem + { + /// + /// Initializes a new instance of the ConnectivityGroupItem class. + /// + public ConnectivityGroupItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectivityGroupItem class. + /// + /// Network group Id. + /// Flag if need to use hub gateway. + /// Possible values include: 'False', 'True' + /// Flag if global is supported. Possible values + /// include: 'False', 'True' + /// Group connectivity type. Possible + /// values include: 'None', 'DirectlyConnected' + public ConnectivityGroupItem(string networkGroupId = default(string), string useHubGateway = default(string), string isGlobal = default(string), string groupConnectivity = default(string)) + { + NetworkGroupId = networkGroupId; + UseHubGateway = useHubGateway; + IsGlobal = isGlobal; + GroupConnectivity = groupConnectivity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network group Id. + /// + [JsonProperty(PropertyName = "networkGroupId")] + public string NetworkGroupId { get; set; } + + /// + /// Gets or sets flag if need to use hub gateway. Possible values + /// include: 'False', 'True' + /// + [JsonProperty(PropertyName = "useHubGateway")] + public string UseHubGateway { get; set; } + + /// + /// Gets or sets flag if global is supported. Possible values include: + /// 'False', 'True' + /// + [JsonProperty(PropertyName = "isGlobal")] + public string IsGlobal { get; set; } + + /// + /// Gets or sets group connectivity type. Possible values include: + /// 'None', 'DirectlyConnected' + /// + [JsonProperty(PropertyName = "groupConnectivity")] + public string GroupConnectivity { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs new file mode 100644 index 000000000000..bc7499e64980 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for ConnectivityTopology. + /// + public static class ConnectivityTopology + { + public const string HubAndSpoke = "HubAndSpoke"; + public const string Mesh = "Mesh"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs similarity index 61% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs index 849a8b8eeb01..f360566a259f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs @@ -12,12 +12,13 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for GatewayLoadBalancerTunnelInterfaceType. + /// Defines values for CreatedByType. /// - public static class GatewayLoadBalancerTunnelInterfaceType + public static class CreatedByType { - public const string None = "None"; - public const string Internal = "Internal"; - public const string External = "External"; + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs index 42337c4a1237..4be854e1b5a9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs @@ -43,14 +43,6 @@ public CustomIpPrefix() /// IP prefix. /// The prefix range in CIDR notation. Should /// include the start address and the prefix length. - /// Signed message for WAN - /// validation. - /// Authorization message for WAN - /// validation. - /// The Parent CustomIpPrefix for - /// IPv6 /64 CustomIpPrefix. - /// The list of all Children for - /// IPv6 /48 CustomIpPrefix. /// The commissioned state of the /// Custom IP Prefix. Possible values include: 'Provisioning', /// 'Provisioned', 'Commissioning', 'Commissioned', 'Decommissioning', @@ -59,8 +51,6 @@ public CustomIpPrefix() /// PublicIpPrefixes. /// The resource GUID property of the custom /// IP prefix resource. - /// The reason why resource is in failed - /// state. /// The provisioning state of the /// custom IP prefix resource. Possible values include: 'Succeeded', /// 'Updating', 'Deleting', 'Failed' @@ -68,19 +58,14 @@ public CustomIpPrefix() /// the resource is updated. /// A list of availability zones denoting the IP /// allocated for the resource needs to come from. - public CustomIpPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string cidr = default(string), string signedMessage = default(string), string authorizationMessage = default(string), CustomIpPrefix customIpPrefixParent = default(CustomIpPrefix), IList childCustomIpPrefixes = default(IList), string commissionedState = default(string), IList publicIpPrefixes = default(IList), string resourceGuid = default(string), string failedReason = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) + public CustomIpPrefix(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), string cidr = default(string), string commissionedState = default(string), IList publicIpPrefixes = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; Cidr = cidr; - SignedMessage = signedMessage; - AuthorizationMessage = authorizationMessage; - CustomIpPrefixParent = customIpPrefixParent; - ChildCustomIpPrefixes = childCustomIpPrefixes; CommissionedState = commissionedState; PublicIpPrefixes = publicIpPrefixes; ResourceGuid = resourceGuid; - FailedReason = failedReason; ProvisioningState = provisioningState; Etag = etag; Zones = zones; @@ -105,30 +90,6 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "properties.cidr")] public string Cidr { get; set; } - /// - /// Gets or sets signed message for WAN validation. - /// - [JsonProperty(PropertyName = "properties.signedMessage")] - public string SignedMessage { get; set; } - - /// - /// Gets or sets authorization message for WAN validation. - /// - [JsonProperty(PropertyName = "properties.authorizationMessage")] - public string AuthorizationMessage { get; set; } - - /// - /// Gets or sets the Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. - /// - [JsonProperty(PropertyName = "properties.customIpPrefixParent")] - public CustomIpPrefix CustomIpPrefixParent { get; set; } - - /// - /// Gets the list of all Children for IPv6 /48 CustomIpPrefix. - /// - [JsonProperty(PropertyName = "properties.childCustomIpPrefixes")] - public IList ChildCustomIpPrefixes { get; private set; } - /// /// Gets or sets the commissioned state of the Custom IP Prefix. /// Possible values include: 'Provisioning', 'Provisioned', @@ -150,12 +111,6 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; private set; } - /// - /// Gets the reason why resource is in failed state. - /// - [JsonProperty(PropertyName = "properties.failedReason")] - public string FailedReason { get; private set; } - /// /// Gets the provisioning state of the custom IP prefix resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', @@ -178,5 +133,18 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs new file mode 100644 index 000000000000..6dc262142654 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs @@ -0,0 +1,174 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network default admin rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class DefaultAdminRule : BaseAdminRule + { + /// + /// Initializes a new instance of the DefaultAdminRule class. + /// + public DefaultAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultAdminRule class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// Default rule flag. + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// Indicates the access allowed for this + /// particular rule. Possible values include: 'Allow', 'Deny', + /// 'AlwaysAllow' + /// The priority of the rule. The value can be + /// between 1 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public DefaultAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets or sets default rule flag. + /// + [JsonProperty(PropertyName = "properties.flag")] + public string Flag { get; set; } + + /// + /// Gets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; private set; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// Gets indicates the access allowed for this particular rule. + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [JsonProperty(PropertyName = "properties.access")] + public string Access { get; private set; } + + /// + /// Gets the priority of the rule. The value can be between 1 and 4096. + /// The priority number must be unique for each rule in the collection. + /// The lower the priority number, the higher the priority of the rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int? Priority { get; private set; } + + /// + /// Gets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs new file mode 100644 index 000000000000..33e2654c5b61 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs @@ -0,0 +1,151 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network security default user rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class DefaultUserRule : BaseUserRule + { + /// + /// Initializes a new instance of the DefaultUserRule class. + /// + public DefaultUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultUserRule class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// Default rule flag. + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public DefaultUserRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string direction = default(string), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets or sets default rule flag. + /// + [JsonProperty(PropertyName = "properties.flag")] + public string Flag { get; set; } + + /// + /// Gets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; private set; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// Gets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; private set; } + + /// + /// Gets the provisioning state of the security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs similarity index 71% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs index a3dfc0fca92e..0b31c0657515 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for BastionHostSkuName. + /// Defines values for DeleteExistingNSGs. /// - public static class BastionHostSkuName + public static class DeleteExistingNSGs { - public const string Basic = "Basic"; - public const string Standard = "Standard"; + public const string False = "False"; + public const string True = "True"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs new file mode 100644 index 000000000000..c9466027f998 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for DeleteExistingPeering. + /// + public static class DeleteExistingPeering + { + public const string False = "False"; + public const string True = "True"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs new file mode 100644 index 000000000000..6386ef465c95 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for DeploymentStatus. + /// + public static class DeploymentStatus + { + public const string NotStarted = "NotStarted"; + public const string Deploying = "Deploying"; + public const string Deployed = "Deployed"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs new file mode 100644 index 000000000000..b330b2a67374 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs @@ -0,0 +1,108 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network base admin rule. + /// + public partial class EffectiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the EffectiveBaseSecurityAdminRule + /// class. + /// + public EffectiveBaseSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveBaseSecurityAdminRule + /// class. + /// + /// Resource ID. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + public EffectiveBaseSecurityAdminRule(string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + ConfigurationDisplayName = configurationDisplayName; + ConfigurationDescription = configurationDescription; + RuleCollectionDisplayName = ruleCollectionDisplayName; + RuleCollectionDescription = ruleCollectionDescription; + RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + RuleGroups = ruleGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a display name of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; set; } + + /// + /// Gets or sets a description of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { get; set; } + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDisplayName")] + public string RuleCollectionDisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription { get; set; } + + /// + /// Gets or sets groups for rule collection + /// + [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public IList RuleCollectionAppliesToGroups { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "ruleGroups")] + public IList RuleGroups { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs new file mode 100644 index 000000000000..154f96e5314c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs @@ -0,0 +1,155 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 network manager effective connectivity configuration + /// + [Rest.Serialization.JsonTransformation] + public partial class EffectiveConnectivityConfiguration + { + /// + /// Initializes a new instance of the + /// EffectiveConnectivityConfiguration class. + /// + public EffectiveConnectivityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// EffectiveConnectivityConfiguration class. + /// + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + /// Resource ID. + /// A friendly name for the resource. + /// A description of the connectivity + /// configuration. + /// The hub vnet Id. + /// Flag if global mesh is supported. Possible + /// values include: 'False', 'True' + /// Groups for configuration + /// The provisioning state of the + /// connectivity configuration resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// Flag if need to remove current + /// existing peerings. Possible values include: 'False', 'True' + /// Effective configuration + /// groups. + public EffectiveConnectivityConfiguration(string connectivityTopology, string id = default(string), string displayName = default(string), string description = default(string), string hubId = default(string), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList)) + { + Id = id; + DisplayName = displayName; + Description = description; + ConnectivityTopology = connectivityTopology; + HubId = hubId; + IsGlobal = isGlobal; + AppliesToGroups = appliesToGroups; + ProvisioningState = provisioningState; + DeleteExistingPeering = deleteExistingPeering; + ConfigurationGroups = configurationGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a friendly name for the resource. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the connectivity configuration. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets connectivity topology type. Possible values include: + /// 'HubAndSpoke', 'Mesh' + /// + [JsonProperty(PropertyName = "properties.connectivityTopology")] + public string ConnectivityTopology { get; set; } + + /// + /// Gets or sets the hub vnet Id. + /// + [JsonProperty(PropertyName = "properties.hubId")] + public string HubId { get; set; } + + /// + /// Gets or sets flag if global mesh is supported. Possible values + /// include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.isGlobal")] + public string IsGlobal { get; set; } + + /// + /// Gets or sets groups for configuration + /// + [JsonProperty(PropertyName = "properties.appliesToGroups")] + public IList AppliesToGroups { get; set; } + + /// + /// Gets the provisioning state of the connectivity configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.deleteExistingPeering")] + public string DeleteExistingPeering { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "configurationGroups")] + public IList ConfigurationGroups { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConnectivityTopology == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs new file mode 100644 index 000000000000..15426ac1fac8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs @@ -0,0 +1,181 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network default admin rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class EffectiveDefaultSecurityAdminRule : EffectiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule + /// class. + /// + public EffectiveDefaultSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule + /// class. + /// + /// Resource ID. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// Default rule flag. + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// Indicates the access allowed for this + /// particular rule. Possible values include: 'Allow', 'Deny', + /// 'AlwaysAllow' + /// The priority of the rule. The value can be + /// between 1 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public EffectiveDefaultSecurityAdminRule(string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), string flag = default(string), string protocol = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string), string provisioningState = default(string)) + : base(id, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets or sets default rule flag. + /// + [JsonProperty(PropertyName = "properties.flag")] + public string Flag { get; set; } + + /// + /// Gets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; private set; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// Gets indicates the access allowed for this particular rule. + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [JsonProperty(PropertyName = "properties.access")] + public string Access { get; private set; } + + /// + /// Gets the priority of the rule. The value can be between 1 and 4096. + /// The priority number must be unique for each rule in the collection. + /// The lower the priority number, the higher the priority of the rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int? Priority { get; private set; } + + /// + /// Gets indicates if the traffic matched against the rule in inbound + /// or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 69143cd10cdb..640f4ea64681 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -31,14 +31,11 @@ public EffectiveNetworkSecurityGroupAssociation() /// Initializes a new instance of the /// EffectiveNetworkSecurityGroupAssociation class. /// - /// The ID of the Azure network manager if - /// assigned. /// The ID of the subnet if assigned. /// The ID of the network interface if /// assigned. - public EffectiveNetworkSecurityGroupAssociation(SubResource networkManager = default(SubResource), SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) + public EffectiveNetworkSecurityGroupAssociation(SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) { - NetworkManager = networkManager; Subnet = subnet; NetworkInterface = networkInterface; CustomInit(); @@ -49,12 +46,6 @@ public EffectiveNetworkSecurityGroupAssociation() /// partial void CustomInit(); - /// - /// Gets or sets the ID of the Azure network manager if assigned. - /// - [JsonProperty(PropertyName = "networkManager")] - public SubResource NetworkManager { get; set; } - /// /// Gets or sets the ID of the subnet if assigned. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs new file mode 100644 index 000000000000..ca3b3fd40591 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs @@ -0,0 +1,201 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network admin rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class EffectiveSecurityAdminRule : EffectiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the EffectiveSecurityAdminRule class. + /// + public EffectiveSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveSecurityAdminRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// Indicates the access allowed for this + /// particular rule. Possible values include: 'Allow', 'Deny', + /// 'AlwaysAllow' + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// Resource ID. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. Restricted + /// to 140 chars. + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// The priority of the rule. The value can be + /// between 1 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public EffectiveSecurityAdminRule(string protocol, string access, string direction, string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) + : base(id, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. Restricted to 140 chars. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// Gets or sets indicates the access allowed for this particular rule. + /// Possible values include: 'Allow', 'Deny', 'AlwaysAllow' + /// + [JsonProperty(PropertyName = "properties.access")] + public string Access { get; set; } + + /// + /// Gets or sets the priority of the rule. The value can be between 1 + /// and 4096. The priority number must be unique for each rule in the + /// collection. The lower the priority number, the higher the priority + /// of the rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int? Priority { get; set; } + + /// + /// Gets or sets indicates if the traffic matched against the rule in + /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Access == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Access"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + if (Priority > 4096) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 4096); + } + if (Priority < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs new file mode 100644 index 000000000000..4712f6cf0c38 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Effective Virtual Network + /// + public partial class EffectiveVirtualNetwork + { + /// + /// Initializes a new instance of the EffectiveVirtualNetwork class. + /// + public EffectiveVirtualNetwork() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveVirtualNetwork class. + /// + /// Effective vnet Id. + /// Location of vnet. + /// Membership Type. Possible values + /// include: 'Static', 'Dynamic' + public EffectiveVirtualNetwork(string id = default(string), string location = default(string), string membershipType = default(string)) + { + Id = id; + Location = location; + MembershipType = membershipType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets effective vnet Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets location of vnet. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets membership Type. Possible values include: 'Static', + /// 'Dynamic' + /// + [JsonProperty(PropertyName = "membershipType")] + public string MembershipType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs new file mode 100644 index 000000000000..0fbd3d1831a8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Result of the request to list Effective Virtual Network. It contains a + /// list of groups and a URL link to get the next set of results. + /// + public partial class EffectiveVirtualNetworksListResult + { + /// + /// Initializes a new instance of the + /// EffectiveVirtualNetworksListResult class. + /// + public EffectiveVirtualNetworksListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// EffectiveVirtualNetworksListResult class. + /// + /// Gets a page of EffectiveVirtualNetwork + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public EffectiveVirtualNetworksListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of EffectiveVirtualNetwork + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs new file mode 100644 index 000000000000..04776ea6dd0e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Effective Virtual Networks Parameter. + /// + public partial class EffectiveVirtualNetworksParameter + { + /// + /// Initializes a new instance of the EffectiveVirtualNetworksParameter + /// class. + /// + public EffectiveVirtualNetworksParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveVirtualNetworksParameter + /// class. + /// + /// Conditional Members. + /// Continuation token for pagination, + /// capturing the next page size and offset, as well as the context of + /// the query. + public EffectiveVirtualNetworksParameter(string conditionalMembers = default(string), string skipToken = default(string)) + { + ConditionalMembers = conditionalMembers; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets conditional Members. + /// + [JsonProperty(PropertyName = "conditionalMembers")] + public string ConditionalMembers { get; set; } + + /// + /// Gets or sets continuation token for pagination, capturing the next + /// page size and offset, as well as the context of the query. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs index 7456d0919b8f..831005217ace 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Network.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -30,14 +31,18 @@ public ExtendedLocation() /// Initializes a new instance of the ExtendedLocation class. /// /// The name of the extended location. - /// The type of the extended location. Possible - /// values include: 'EdgeZone' - public ExtendedLocation(string name = default(string), string type = default(string)) + public ExtendedLocation(string name) { Name = name; - Type = type; CustomInit(); } + /// + /// Static constructor for ExtendedLocation class. + /// + static ExtendedLocation() + { + Type = "EdgeZone"; + } /// /// An initialization method that performs custom operations like setting defaults @@ -51,11 +56,23 @@ public ExtendedLocation() public string Name { get; set; } /// - /// Gets or sets the type of the extended location. Possible values - /// include: 'EdgeZone' + /// The type of the extended location. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public static string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } } } 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 similarity index 92% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIPConfiguration.cs index ad66fc03d071..e3b82f118118 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 @@ -55,8 +55,6 @@ public FrontendIPConfiguration() /// resource. /// The reference to the Public IP Prefix /// resource. - /// The reference to gateway load - /// balancer frontend IP. /// The provisioning state of the /// frontend IP configuration resource. Possible values include: /// 'Succeeded', 'Updating', 'Deleting', 'Failed' @@ -68,7 +66,7 @@ public FrontendIPConfiguration() /// Type of the resource. /// A list of availability zones denoting the IP /// allocated for the resource needs to come from. - public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), SubResource publicIPPrefix = default(SubResource), SubResource gatewayLoadBalancer = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string), IList zones = default(IList)) + public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), SubResource publicIPPrefix = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string), IList zones = default(IList)) : base(id) { InboundNatRules = inboundNatRules; @@ -81,7 +79,6 @@ public FrontendIPConfiguration() Subnet = subnet; PublicIPAddress = publicIPAddress; PublicIPPrefix = publicIPPrefix; - GatewayLoadBalancer = gatewayLoadBalancer; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -161,12 +158,6 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "properties.publicIPPrefix")] public SubResource PublicIPPrefix { get; set; } - /// - /// Gets or sets the reference to gateway load balancer frontend IP. - /// - [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] - public SubResource GatewayLoadBalancer { get; set; } - /// /// Gets the provisioning state of the frontend IP configuration /// resource. Possible values include: 'Succeeded', 'Updating', @@ -203,5 +194,18 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs deleted file mode 100644 index e074a3f6dfce..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Gateway load balancer tunnel interface of a load balancer backend - /// address pool. - /// - public partial class GatewayLoadBalancerTunnelInterface - { - /// - /// Initializes a new instance of the - /// GatewayLoadBalancerTunnelInterface class. - /// - public GatewayLoadBalancerTunnelInterface() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// GatewayLoadBalancerTunnelInterface class. - /// - /// Port of gateway load balancer tunnel - /// interface. - /// Identifier of gateway load balancer tunnel - /// interface. - /// Protocol of gateway load balancer tunnel - /// interface. Possible values include: 'None', 'Native', - /// 'VXLAN' - /// Traffic type of gateway load balancer tunnel - /// interface. Possible values include: 'None', 'Internal', - /// 'External' - public GatewayLoadBalancerTunnelInterface(int? port = default(int?), int? identifier = default(int?), string protocol = default(string), string type = default(string)) - { - Port = port; - Identifier = identifier; - Protocol = protocol; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets port of gateway load balancer tunnel interface. - /// - [JsonProperty(PropertyName = "port")] - public int? Port { get; set; } - - /// - /// Gets or sets identifier of gateway load balancer tunnel interface. - /// - [JsonProperty(PropertyName = "identifier")] - public int? Identifier { get; set; } - - /// - /// Gets or sets protocol of gateway load balancer tunnel interface. - /// Possible values include: 'None', 'Native', 'VXLAN' - /// - [JsonProperty(PropertyName = "protocol")] - public string Protocol { get; set; } - - /// - /// Gets or sets traffic type of gateway load balancer tunnel - /// interface. Possible values include: 'None', 'Internal', 'External' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs similarity index 70% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs index a4972933b927..1887920ed507 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs @@ -12,12 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for GatewayLoadBalancerTunnelProtocol. + /// Defines values for GroupConnectivity. /// - public static class GatewayLoadBalancerTunnelProtocol + public static class GroupConnectivity { public const string None = "None"; - public const string Native = "Native"; - public const string VXLAN = "VXLAN"; + public const string DirectlyConnected = "DirectlyConnected"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs new file mode 100644 index 000000000000..b8d540ddf9df --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// GroupMembers Item. + /// + public partial class GroupMembersItem + { + /// + /// Initializes a new instance of the GroupMembersItem class. + /// + public GroupMembersItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GroupMembersItem class. + /// + /// Vnet Id. + /// Subnet Id. + public GroupMembersItem(string vnetId = default(string), string subnetId = default(string)) + { + VnetId = vnetId; + SubnetId = subnetId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets vnet Id. + /// + [JsonProperty(PropertyName = "vnetId")] + public string VnetId { get; set; } + + /// + /// Gets or sets subnet Id. + /// + [JsonProperty(PropertyName = "subnetId")] + public string SubnetId { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs index fd8a90ac97a1..6c4362bf084d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs @@ -119,5 +119,18 @@ public HubIpConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpAllocationMethod.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPAllocationMethod.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpAllocationMethod.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPAllocationMethod.cs 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 7141647772af..5bca8e8b4870 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 @@ -114,5 +114,18 @@ public IPConfiguration() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } 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 81c585da4bfa..7efd2ff41914 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 @@ -182,5 +182,18 @@ public InboundNatRule() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (BackendIPConfiguration != null) + { + BackendIPConfiguration.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs similarity index 74% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs index 80df58a83add..11c8db830ff0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for SyncRemoteAddressSpace. + /// Defines values for IsGlobal. /// - public static class SyncRemoteAddressSpace + public static class IsGlobal { - public const string True = "true"; + public const string False = "False"; + public const string True = "True"; } } 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 17b7fe0ef374..7db69cc00db7 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 @@ -190,5 +190,78 @@ public LoadBalancer() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (FrontendIPConfigurations != null) + { + foreach (var element in FrontendIPConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (LoadBalancingRules != null) + { + foreach (var element1 in LoadBalancingRules) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (Probes != null) + { + foreach (var element2 in Probes) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + if (InboundNatRules != null) + { + foreach (var element3 in InboundNatRules) + { + if (element3 != null) + { + element3.Validate(); + } + } + } + if (InboundNatPools != null) + { + foreach (var element4 in InboundNatPools) + { + if (element4 != null) + { + element4.Validate(); + } + } + } + if (OutboundRules != null) + { + foreach (var element5 in OutboundRules) + { + if (element5 != null) + { + element5.Validate(); + } + } + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs index 17e411b38951..b7daccca169d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs @@ -30,7 +30,7 @@ public LoadBalancerSku() /// Initializes a new instance of the LoadBalancerSku class. /// /// Name of a load balancer SKU. Possible values - /// include: 'Basic', 'Standard', 'Gateway' + /// include: 'Basic', 'Standard' /// Tier of a load balancer SKU. Possible values /// include: 'Regional', 'Global' public LoadBalancerSku(string name = default(string), string tier = default(string)) @@ -47,7 +47,7 @@ public LoadBalancerSku() /// /// Gets or sets name of a load balancer SKU. Possible values include: - /// 'Basic', 'Standard', 'Gateway' + /// 'Basic', 'Standard' /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs index bad640c6edd2..47d143e327b1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs @@ -18,6 +18,5 @@ public static class LoadBalancerSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; - public const string Gateway = "Gateway"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs deleted file mode 100644 index fd58d9f58f70..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights 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; - - /// - /// The request for a VIP swap. - /// - public partial class LoadBalancerVipSwapRequest - { - /// - /// Initializes a new instance of the LoadBalancerVipSwapRequest class. - /// - public LoadBalancerVipSwapRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LoadBalancerVipSwapRequest class. - /// - /// A list of frontend IP - /// configuration resources that should swap VIPs. - public LoadBalancerVipSwapRequest(IList frontendIPConfigurations = default(IList)) - { - FrontendIPConfigurations = frontendIPConfigurations; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a list of frontend IP configuration resources that - /// should swap VIPs. - /// - [JsonProperty(PropertyName = "frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs deleted file mode 100644 index becef2a1e7ed..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// VIP swap request's frontend IP configuration object. - /// - [Rest.Serialization.JsonTransformation] - public partial class LoadBalancerVipSwapRequestFrontendIPConfiguration - { - /// - /// Initializes a new instance of the - /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. - /// - public LoadBalancerVipSwapRequestFrontendIPConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. - /// - /// The ID of frontend IP configuration - /// resource. - /// A reference to public IP address - /// resource. - public LoadBalancerVipSwapRequestFrontendIPConfiguration(string id = default(string), SubResource publicIPAddress = default(SubResource)) - { - Id = id; - PublicIPAddress = publicIPAddress; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the ID of frontend IP configuration resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets a reference to public IP address resource. - /// - [JsonProperty(PropertyName = "properties.publicIPAddress")] - public SubResource PublicIPAddress { get; 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 109185a6cc7e..ba4e7129fca1 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 @@ -13,8 +13,6 @@ 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; /// @@ -47,8 +45,6 @@ public LoadBalancingRule() /// A reference to a pool of DIPs. /// Inbound traffic is randomly load balanced across IPs in the backend /// IPs. - /// An array of references to pool of - /// DIPs. /// The reference to the load balancer probe used /// by the load balancing rule. /// The load distribution policy for @@ -81,12 +77,11 @@ public LoadBalancingRule() /// A unique read-only string that changes whenever /// the resource is updated. /// Type of the resource. - public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), IList backendAddressPools = default(IList), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), bool? enableTcpReset = default(bool?), bool? disableOutboundSnat = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { FrontendIPConfiguration = frontendIPConfiguration; BackendAddressPool = backendAddressPool; - BackendAddressPools = backendAddressPools; Probe = probe; Protocol = protocol; LoadDistribution = loadDistribution; @@ -121,12 +116,6 @@ public LoadBalancingRule() [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } - /// - /// Gets or sets an array of references to pool of DIPs. - /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } - /// /// Gets or sets the reference to the load balancer probe used by the /// load balancing rule. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MemberType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MemberType.cs new file mode 100644 index 000000000000..e390724e9e9b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MemberType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for MemberType. + /// + public static class MemberType + { + public const string VirtualNetwork = "VirtualNetwork"; + public const string Subnet = "Subnet"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs new file mode 100644 index 000000000000..4b0ba6401381 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for MembershipType. + /// + public static class MembershipType + { + public const string Static = "Static"; + public const string Dynamic = "Dynamic"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs new file mode 100644 index 000000000000..5b8198e2a5be --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 network group resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkGroup : ProxyResource + { + /// + /// Initializes a new instance of the NetworkGroup class. + /// + public NetworkGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkGroup class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A friendly name for the network + /// group. + /// A description of the network + /// group. + /// Group member type. Possible values + /// include: 'VirtualNetwork', 'Subnet' + /// Group members of network group. + /// Network group conditional + /// filter. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public NetworkGroup(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), string memberType = default(string), IList groupMembers = default(IList), string conditionalMembership = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + MemberType = memberType; + GroupMembers = groupMembers; + ConditionalMembership = conditionalMembership; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the network group. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network group. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets group member type. Possible values include: + /// 'VirtualNetwork', 'Subnet' + /// + [JsonProperty(PropertyName = "properties.memberType")] + public string MemberType { get; set; } + + /// + /// Gets or sets group members of network group. + /// + [JsonProperty(PropertyName = "properties.groupMembers")] + public IList GroupMembers { get; set; } + + /// + /// Gets or sets network group conditional filter. + /// + [JsonProperty(PropertyName = "properties.conditionalMembership")] + public string ConditionalMembership { get; set; } + + /// + /// Gets the provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs similarity index 57% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs index 75f172a4cef6..dde367cf19ed 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs @@ -14,26 +14,27 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// The sku of this Bastion Host. + /// Defines headers for CreateOrUpdate operation. /// - public partial class Sku + public partial class NetworkGroupsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the Sku class. + /// Initializes a new instance of the + /// NetworkGroupsCreateOrUpdateHeaders class. /// - public Sku() + public NetworkGroupsCreateOrUpdateHeaders() { CustomInit(); } /// - /// Initializes a new instance of the Sku class. + /// Initializes a new instance of the + /// NetworkGroupsCreateOrUpdateHeaders class. /// - /// The name of this Bastion Host. Possible values - /// include: 'Basic', 'Standard' - public Sku(string name = default(string)) + /// The current entity tag. + public NetworkGroupsCreateOrUpdateHeaders(string eTag = default(string)) { - Name = name; + ETag = eTag; CustomInit(); } @@ -43,11 +44,10 @@ public Sku() partial void CustomInit(); /// - /// Gets or sets the name of this Bastion Host. Possible values - /// include: 'Basic', 'Standard' + /// Gets or sets the current entity tag. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; 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 e9a8ebc700fb..9bedac0024b0 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 @@ -70,8 +70,6 @@ public NetworkInterface() /// The provisioning state of the /// network interface resource. Possible values include: 'Succeeded', /// 'Updating', 'Deleting', 'Failed' - /// WorkloadType of the NetworkInterface for - /// BareMetal resources /// Type of Network Interface resource. Possible /// values include: 'Standard', 'Elastic' /// Privatelinkservice of the network @@ -81,7 +79,7 @@ public NetworkInterface() /// 'Abort', 'Committed' /// A unique read-only string that changes whenever /// the resource is updated. - public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), IList ipConfigurations = default(IList), IList tapConfigurations = default(IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), IList hostedWorkloads = default(IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), string workloadType = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string etag = default(string)) + public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), IList ipConfigurations = default(IList), IList tapConfigurations = default(IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), IList hostedWorkloads = default(IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string etag = default(string)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; @@ -99,7 +97,6 @@ public NetworkInterface() DscpConfiguration = dscpConfiguration; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; - WorkloadType = workloadType; NicType = nicType; PrivateLinkService = privateLinkService; MigrationPhase = migrationPhase; @@ -209,13 +206,6 @@ public NetworkInterface() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } - /// - /// Gets or sets workloadType of the NetworkInterface for BareMetal - /// resources - /// - [JsonProperty(PropertyName = "properties.workloadType")] - public string WorkloadType { get; set; } - /// /// Gets or sets type of Network Interface resource. Possible values /// include: 'Standard', 'Elastic' @@ -244,5 +234,46 @@ public NetworkInterface() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (PrivateEndpoint != null) + { + PrivateEndpoint.Validate(); + } + if (IpConfigurations != null) + { + foreach (var element in IpConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (TapConfigurations != null) + { + foreach (var element1 in TapConfigurations) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (PrivateLinkService != null) + { + PrivateLinkService.Validate(); + } + } } } 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 similarity index 81% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIPConfiguration.cs index 80fbd5539228..89f950d3af69 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 @@ -37,8 +37,6 @@ public NetworkInterfaceIPConfiguration() /// class. /// /// Resource ID. - /// The reference to gateway load - /// balancer frontend IP. /// The reference to Virtual Network /// Taps. /// The reference @@ -73,10 +71,9 @@ public NetworkInterfaceIPConfiguration() /// A unique read-only string that changes whenever /// the resource is updated. /// Resource type. - public NetworkInterfaceIPConfiguration(string id = default(string), SubResource gatewayLoadBalancer = default(SubResource), IList virtualNetworkTaps = default(IList), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), IList applicationSecurityGroups = default(IList), string provisioningState = default(string), NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties), string name = default(string), string etag = default(string), string type = default(string)) + public NetworkInterfaceIPConfiguration(string id = default(string), IList virtualNetworkTaps = default(IList), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), IList applicationSecurityGroups = default(IList), string provisioningState = default(string), NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default(NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { - GatewayLoadBalancer = gatewayLoadBalancer; VirtualNetworkTaps = virtualNetworkTaps; ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; @@ -101,12 +98,6 @@ public NetworkInterfaceIPConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets the reference to gateway load balancer frontend IP. - /// - [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] - public SubResource GatewayLoadBalancer { get; set; } - /// /// Gets or sets the reference to Virtual Network Taps. /// @@ -213,5 +204,38 @@ public NetworkInterfaceIPConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualNetworkTaps != null) + { + foreach (var element in VirtualNetworkTaps) + { + if (element != null) + { + element.Validate(); + } + } + } + if (LoadBalancerInboundNatRules != null) + { + foreach (var element1 in LoadBalancerInboundNatRules) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } 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 7be020d7ccf3..2b922b608c31 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 @@ -96,5 +96,18 @@ public NetworkInterfaceTapConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualNetworkTap != null) + { + VirtualNetworkTap.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs new file mode 100644 index 000000000000..4e4ac7a275b5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 Managed Network resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkManager : Resource + { + /// + /// Initializes a new instance of the NetworkManager class. + /// + public NetworkManager() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManager class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A friendly name for the network + /// manager. + /// A description of the network + /// manager. + /// Scope of Network + /// Manager. + /// Scope Access. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + public NetworkManager(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes = default(NetworkManagerPropertiesNetworkManagerScopes), IList networkManagerScopeAccesses = default(IList), string provisioningState = default(string), string etag = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location, tags) + { + DisplayName = displayName; + Description = description; + NetworkManagerScopes = networkManagerScopes; + NetworkManagerScopeAccesses = networkManagerScopeAccesses; + ProvisioningState = provisioningState; + Etag = etag; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the network manager. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network manager. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets scope of Network Manager. + /// + [JsonProperty(PropertyName = "properties.networkManagerScopes")] + public NetworkManagerPropertiesNetworkManagerScopes NetworkManagerScopes { get; set; } + + /// + /// Gets or sets scope Access. + /// + [JsonProperty(PropertyName = "properties.networkManagerScopeAccesses")] + public IList NetworkManagerScopeAccesses { get; set; } + + /// + /// Gets the provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { 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; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs new file mode 100644 index 000000000000..29bacf96030c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Manager Commit. + /// + public partial class NetworkManagerCommit + { + /// + /// Initializes a new instance of the NetworkManagerCommit class. + /// + public NetworkManagerCommit() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerCommit class. + /// + /// Commit Id. + /// List of target locations. + /// List of configuration ids. + /// Commit Type. Possible values include: + /// 'SecurityAdmin', 'SecurityUser', 'Connectivity' + public NetworkManagerCommit(string commitId = default(string), IList targetLocations = default(IList), IList configurationIds = default(IList), string commitType = default(string)) + { + CommitId = commitId; + TargetLocations = targetLocations; + ConfigurationIds = configurationIds; + CommitType = commitType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets commit Id. + /// + [JsonProperty(PropertyName = "commitId")] + public string CommitId { get; private set; } + + /// + /// Gets or sets list of target locations. + /// + [JsonProperty(PropertyName = "targetLocations")] + public IList TargetLocations { get; set; } + + /// + /// Gets or sets list of configuration ids. + /// + [JsonProperty(PropertyName = "configurationIds")] + public IList ConfigurationIds { get; set; } + + /// + /// Gets or sets commit Type. Possible values include: 'SecurityAdmin', + /// 'SecurityUser', 'Connectivity' + /// + [JsonProperty(PropertyName = "commitType")] + public string CommitType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs new file mode 100644 index 000000000000..3889883d399b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Manager Deployment Status. + /// + public partial class NetworkManagerDeploymentStatus + { + /// + /// Initializes a new instance of the NetworkManagerDeploymentStatus + /// class. + /// + public NetworkManagerDeploymentStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerDeploymentStatus + /// class. + /// + /// Commit Time. + /// Region Name. + /// Deployment Status. Possible values + /// include: 'NotStarted', 'Deploying', 'Deployed', 'Failed' + /// List of configuration ids. + /// Possible values include: + /// 'SecurityAdmin', 'SecurityUser', 'Connectivity' + /// Error Message. + public NetworkManagerDeploymentStatus(System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string deploymentStatus = default(string), IList configurationIds = default(IList), string deploymentType = default(string), string errorMessage = default(string)) + { + CommitTime = commitTime; + Region = region; + DeploymentStatus = deploymentStatus; + ConfigurationIds = configurationIds; + DeploymentType = deploymentType; + ErrorMessage = errorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets commit Time. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets region Name. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets deployment Status. Possible values include: + /// 'NotStarted', 'Deploying', 'Deployed', 'Failed' + /// + [JsonProperty(PropertyName = "deploymentStatus")] + public string DeploymentStatus { get; set; } + + /// + /// Gets or sets list of configuration ids. + /// + [JsonProperty(PropertyName = "configurationIds")] + public IList ConfigurationIds { get; set; } + + /// + /// Gets or sets possible values include: 'SecurityAdmin', + /// 'SecurityUser', 'Connectivity' + /// + [JsonProperty(PropertyName = "deploymentType")] + public string DeploymentType { get; set; } + + /// + /// Gets or sets error Message. + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs new file mode 100644 index 000000000000..026436bdb0fe --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// A list of Network Manager Deployment Status + /// + public partial class NetworkManagerDeploymentStatusListResult + { + /// + /// Initializes a new instance of the + /// NetworkManagerDeploymentStatusListResult class. + /// + public NetworkManagerDeploymentStatusListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkManagerDeploymentStatusListResult class. + /// + /// Gets a page of Network Manager Deployment + /// Status + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public NetworkManagerDeploymentStatusListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of Network Manager Deployment Status + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs new file mode 100644 index 000000000000..fcc47e879413 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Manager Deployment Status Parameter. + /// + public partial class NetworkManagerDeploymentStatusParameter + { + /// + /// Initializes a new instance of the + /// NetworkManagerDeploymentStatusParameter class. + /// + public NetworkManagerDeploymentStatusParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkManagerDeploymentStatusParameter class. + /// + /// List of locations. + /// List of deployment types. + /// Continuation token for pagination, + /// capturing the next page size and offset, as well as the context of + /// the query. + public NetworkManagerDeploymentStatusParameter(IList regions = default(IList), IList deploymentTypes = default(IList), string skipToken = default(string)) + { + Regions = regions; + DeploymentTypes = deploymentTypes; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of locations. + /// + [JsonProperty(PropertyName = "regions")] + public IList Regions { get; set; } + + /// + /// Gets or sets list of deployment types. + /// + [JsonProperty(PropertyName = "deploymentTypes")] + public IList DeploymentTypes { get; set; } + + /// + /// Gets or sets continuation token for pagination, capturing the next + /// page size and offset, as well as the context of the query. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs new file mode 100644 index 000000000000..5fb830511a42 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list + /// networkManagerEffectiveConnectivityConfiguration. It contains a list of + /// groups and a skiptoken to get the next set of results. + /// + public partial class NetworkManagerEffectiveConnectivityConfigurationListResult + { + /// + /// Initializes a new instance of the + /// NetworkManagerEffectiveConnectivityConfigurationListResult class. + /// + public NetworkManagerEffectiveConnectivityConfigurationListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkManagerEffectiveConnectivityConfigurationListResult class. + /// + /// Gets a page of + /// NetworkManagerEffectiveConnectivityConfiguration + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public NetworkManagerEffectiveConnectivityConfigurationListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of NetworkManagerEffectiveConnectivityConfiguration + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs new file mode 100644 index 000000000000..eebb5c4f8b10 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list + /// networkManagerEffectiveSecurityAdminRules. It contains a list of groups + /// and a skiptoken to get the next set of results. + /// + public partial class NetworkManagerEffectiveSecurityAdminRulesListResult + { + /// + /// Initializes a new instance of the + /// NetworkManagerEffectiveSecurityAdminRulesListResult class. + /// + public NetworkManagerEffectiveSecurityAdminRulesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkManagerEffectiveSecurityAdminRulesListResult class. + /// + /// Gets a page of + /// NetworkManagerEffectiveSecurityAdminRules + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public NetworkManagerEffectiveSecurityAdminRulesListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of NetworkManagerEffectiveSecurityAdminRules + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs new file mode 100644 index 000000000000..0812942d9e55 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Scope of Network Manager. + /// + public partial class NetworkManagerPropertiesNetworkManagerScopes + { + /// + /// Initializes a new instance of the + /// NetworkManagerPropertiesNetworkManagerScopes class. + /// + public NetworkManagerPropertiesNetworkManagerScopes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkManagerPropertiesNetworkManagerScopes class. + /// + /// List of management groups. + /// List of subscriptions. + public NetworkManagerPropertiesNetworkManagerScopes(IList managementGroups = default(IList), IList subscriptions = default(IList)) + { + ManagementGroups = managementGroups; + Subscriptions = subscriptions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of management groups. + /// + [JsonProperty(PropertyName = "managementGroups")] + public IList ManagementGroups { get; set; } + + /// + /// Gets or sets list of subscriptions. + /// + [JsonProperty(PropertyName = "subscriptions")] + public IList Subscriptions { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs new file mode 100644 index 000000000000..a85140d0bd77 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Network manager security group item. + /// + public partial class NetworkManagerSecurityGroupItem + { + /// + /// Initializes a new instance of the NetworkManagerSecurityGroupItem + /// class. + /// + public NetworkManagerSecurityGroupItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerSecurityGroupItem + /// class. + /// + /// Network manager group Id. + public NetworkManagerSecurityGroupItem(string networkGroupId = default(string)) + { + NetworkGroupId = networkGroupId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network manager group Id. + /// + [JsonProperty(PropertyName = "networkGroupId")] + public string NetworkGroupId { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs new file mode 100644 index 000000000000..7882f7a10120 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 Network Security Perimeter resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkSecurityPerimeter : Resource + { + /// + /// Initializes a new instance of the NetworkSecurityPerimeter class. + /// + public NetworkSecurityPerimeter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkSecurityPerimeter class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A friendly name for the network security + /// perimeter. + /// A description of the network security + /// perimeter. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// A unique read-only string that changes whenever + /// the resource is updated. + public NetworkSecurityPerimeter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), string provisioningState = default(string), string etag = default(string)) + : base(id, name, type, location, tags) + { + DisplayName = displayName; + Description = description; + ProvisioningState = provisioningState; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the network security perimeter. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network security perimeter. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets the provisioning state of the scope assignment resource. + /// Possible values include: 'Succeeded', 'Updating', 'Deleting', + /// 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { 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/PerimeterAssociableResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs new file mode 100644 index 000000000000..14e898b1e6cb --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Resource that is onboarded to use network security perimeter. Also + /// referred as perimeter associable resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PerimeterAssociableResource : Resource + { + /// + /// Initializes a new instance of the PerimeterAssociableResource + /// class. + /// + public PerimeterAssociableResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PerimeterAssociableResource + /// class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A friendly name for the properties of + /// perimeter associable resources. + /// Resource type/provider name. + /// Public DNS zone names of the + /// resources. + public PerimeterAssociableResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string resourceType = default(string), IList publicDnsZones = default(IList)) + : base(id, name, type, location, tags) + { + DisplayName = displayName; + ResourceType = resourceType; + PublicDnsZones = publicDnsZones; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the properties of perimeter associable + /// resources. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets resource type/provider name. + /// + [JsonProperty(PropertyName = "properties.resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets public DNS zone names of the resources. + /// + [JsonProperty(PropertyName = "properties.publicDnsZones")] + public IList PublicDnsZones { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs new file mode 100644 index 000000000000..7841fb7b56a8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Paged list of perimeter associable resources. + /// + public partial class PerimeterAssociableResourcesListResult + { + /// + /// Initializes a new instance of the + /// PerimeterAssociableResourcesListResult class. + /// + public PerimeterAssociableResourcesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PerimeterAssociableResourcesListResult class. + /// + /// Gets paged list of perimeter associable + /// resources. + /// Gets the URL to get the next page of + /// results. + public PerimeterAssociableResourcesListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets paged list of perimeter associable resources. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets the URL to get the next page of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs index 15ebdf469c64..69188a800488 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs @@ -95,6 +95,10 @@ public PolicySettings() /// public virtual void Validate() { + if (MaxRequestBodySizeInKb > 128) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); + } if (MaxRequestBodySizeInKb < 8) { throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); 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 9c28f6475d5e..e4977861001f 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 @@ -133,5 +133,28 @@ public PrivateEndpoint() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (NetworkInterfaces != null) + { + foreach (var element in NetworkInterfaces) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } 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 575e64c9ed23..484410d7d937 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 @@ -113,5 +113,18 @@ public PrivateEndpointConnection() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateEndpoint != null) + { + PrivateEndpoint.Validate(); + } + } } } 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 2929365f8956..4280b3ff149c 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 @@ -163,5 +163,48 @@ public PrivateLinkService() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (LoadBalancerFrontendIpConfigurations != null) + { + foreach (var element in LoadBalancerFrontendIpConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (NetworkInterfaces != null) + { + foreach (var element1 in NetworkInterfaces) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (PrivateEndpointConnections != null) + { + foreach (var element2 in PrivateEndpointConnections) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..8480d098c562 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Proxy resource representation. + /// + public partial class ProxyResource : IResource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + { + Id = id; + Name = name; + Type = type; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { 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/PublicIpAddress.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddress.cs similarity index 93% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddress.cs index e3988bc735bb..97606232a8c1 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 @@ -75,14 +75,11 @@ public PublicIPAddress() /// 'Committed' /// The linked public IP address of /// the public IP address resource. - /// Specify what happens to the public IP - /// address when the VM using it is deleted. Possible values include: - /// 'Delete', 'Detach' /// A unique read-only string that changes whenever /// the resource is updated. /// A list of availability zones denoting the IP /// allocated for the resource needs to come from. - public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PublicIPAddressSku sku = default(PublicIPAddressSku), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), DdosSettings ddosSettings = default(DdosSettings), IList ipTags = default(IList), string ipAddress = default(string), SubResource publicIPPrefix = default(SubResource), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), PublicIPAddress servicePublicIPAddress = default(PublicIPAddress), NatGateway natGateway = default(NatGateway), string migrationPhase = default(string), PublicIPAddress linkedPublicIPAddress = default(PublicIPAddress), string deleteOption = default(string), string etag = default(string), IList zones = default(IList)) + public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), PublicIPAddressSku sku = default(PublicIPAddressSku), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), DdosSettings ddosSettings = default(DdosSettings), IList ipTags = default(IList), string ipAddress = default(string), SubResource publicIPPrefix = default(SubResource), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), PublicIPAddress servicePublicIPAddress = default(PublicIPAddress), NatGateway natGateway = default(NatGateway), string migrationPhase = default(string), PublicIPAddress linkedPublicIPAddress = default(PublicIPAddress), string etag = default(string), IList zones = default(IList)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; @@ -102,7 +99,6 @@ public PublicIPAddress() NatGateway = natGateway; MigrationPhase = migrationPhase; LinkedPublicIPAddress = linkedPublicIPAddress; - DeleteOption = deleteOption; Etag = etag; Zones = zones; CustomInit(); @@ -227,13 +223,6 @@ public PublicIPAddress() [JsonProperty(PropertyName = "properties.linkedPublicIPAddress")] public PublicIPAddress LinkedPublicIPAddress { get; set; } - /// - /// Gets or sets specify what happens to the public IP address when the - /// VM using it is deleted. Possible values include: 'Delete', 'Detach' - /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -248,5 +237,30 @@ public PublicIPAddress() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (IpConfiguration != null) + { + IpConfiguration.Validate(); + } + if (ServicePublicIPAddress != null) + { + ServicePublicIPAddress.Validate(); + } + if (LinkedPublicIPAddress != null) + { + LinkedPublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddressDnsSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddressDnsSettings.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddressDnsSettings.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddressDnsSettings.cs 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 9492698563f9..83118c047128 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 @@ -182,5 +182,18 @@ public PublicIPPrefix() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs new file mode 100644 index 000000000000..6a96945d6994 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Query Request Options + /// + public partial class QueryRequestOptions + { + /// + /// Initializes a new instance of the QueryRequestOptions class. + /// + public QueryRequestOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryRequestOptions class. + /// + /// When present, the value can be passed to a + /// subsequent query call (together with the same query and scopes used + /// in the current request) to retrieve the next page of data. + public QueryRequestOptions(string skipToken = default(string)) + { + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets when present, the value can be passed to a subsequent + /// query call (together with the same query and scopes used in the + /// current request) to retrieve the next page of data. + /// + [JsonProperty(PropertyName = "$skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs new file mode 100644 index 000000000000..2cca3c7c7b08 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Defines the rule collection. + /// + [Rest.Serialization.JsonTransformation] + public partial class RuleCollection : ProxyResource + { + /// + /// Initializes a new instance of the RuleCollection class. + /// + public RuleCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RuleCollection class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for configuration + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public RuleCollection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + AppliesToGroups = appliesToGroups; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets groups for configuration + /// + [JsonProperty(PropertyName = "properties.appliesToGroups")] + public IList AppliesToGroups { get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs new file mode 100644 index 000000000000..7656ef08ae43 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the security configuration + /// + [Rest.Serialization.JsonTransformation] + public partial class SecurityConfiguration : ProxyResource + { + /// + /// Initializes a new instance of the SecurityConfiguration class. + /// + public SecurityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityConfiguration class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A display name of the security + /// configuration. + /// A description of the security + /// configuration. + /// Security Type. Possible values include: + /// 'AdminPolicy', 'UserPolicy' + /// Flag if need to delete existing + /// network security groups. Possible values include: 'False', + /// 'True' + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public SecurityConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), string securityType = default(string), string deleteExistingNSGs = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + SecurityType = securityType; + DeleteExistingNSGs = deleteExistingNSGs; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a display name of the security configuration. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the security configuration. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets security Type. Possible values include: 'AdminPolicy', + /// 'UserPolicy' + /// + [JsonProperty(PropertyName = "properties.securityType")] + public string SecurityType { get; set; } + + /// + /// Gets or sets flag if need to delete existing network security + /// groups. Possible values include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.deleteExistingNSGs")] + public string DeleteExistingNSGs { get; set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs similarity index 63% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs index 0e8946f41322..8fa24ddae16e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs @@ -12,12 +12,12 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for PreferredRoutingGateway. + /// Defines values for SecurityConfigurationRuleAccess. /// - public static class PreferredRoutingGateway + public static class SecurityConfigurationRuleAccess { - public const string ExpressRoute = "ExpressRoute"; - public const string VpnGateway = "VpnGateway"; - public const string None = "None"; + public const string Allow = "Allow"; + public const string Deny = "Deny"; + public const string AlwaysAllow = "AlwaysAllow"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs new file mode 100644 index 000000000000..266a50b5281a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for SecurityConfigurationRuleDirection. + /// + public static class SecurityConfigurationRuleDirection + { + public const string Inbound = "Inbound"; + public const string Outbound = "Outbound"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs new file mode 100644 index 000000000000..d4ca62c2e1b8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for SecurityConfigurationRuleProtocol. + /// + public static class SecurityConfigurationRuleProtocol + { + public const string Tcp = "Tcp"; + public const string Udp = "Udp"; + public const string Icmp = "Icmp"; + public const string Esp = "Esp"; + public const string Any = "Any"; + public const string Ah = "Ah"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs new file mode 100644 index 000000000000..917cef4ae48f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for SecurityType. + /// + public static class SecurityType + { + public const string AdminPolicy = "AdminPolicy"; + public const string UserPolicy = "UserPolicy"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..c8f4a089574c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The type of identity that last + /// modified the resource. + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs similarity index 72% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs index 79c56e63572b..6bf6370a4632 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for DeleteOptions. + /// Defines values for UseHubGateway. /// - public static class DeleteOptions + public static class UseHubGateway { - public const string Delete = "Delete"; - public const string Detach = "Detach"; + public const string False = "False"; + public const string True = "True"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs new file mode 100644 index 000000000000..27563356a0c2 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs @@ -0,0 +1,159 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// Network security user rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class UserRule : BaseUserRule + { + /// + /// Initializes a new instance of the UserRule class. + /// + public UserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + /// A friendly name for the rule. + /// A description for this rule. + /// The CIDR or source IP ranges. + /// The destination address prefixes. CIDR + /// or destination IP ranges. + /// The source port ranges. + /// The destination port + /// ranges. + /// The provisioning state of the + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public UserRule(string protocol, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets network protocol this rule applies to. Possible values + /// include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', 'Ah' + /// + [JsonProperty(PropertyName = "properties.protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; set; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// Gets or sets indicates if the traffic matched against the rule in + /// inbound or outbound. Possible values include: 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; set; } + + /// + /// Gets the provisioning state of the security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + } + } +} 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 ceb19131945d..0f7c9234b6e0 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 @@ -73,12 +73,9 @@ public VirtualHub() /// VirtualRouter IPs. /// Flag to control transit /// for VirtualRouter hub. - /// The preferred gateway to - /// route on-prem traffic. Possible values include: 'ExpressRoute', - /// 'VpnGateway', 'None' /// 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), SubResource securityPartnerProvider = default(SubResource), 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 routingState = default(string), IList bgpConnections = default(IList), IList ipConfigurations = default(IList), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string preferredRoutingGateway = 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), SubResource securityPartnerProvider = default(SubResource), 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 routingState = default(string), IList bgpConnections = default(IList), IList ipConfigurations = default(IList), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { VirtualWan = virtualWan; @@ -99,7 +96,6 @@ public VirtualHub() VirtualRouterAsn = virtualRouterAsn; VirtualRouterIps = virtualRouterIps; AllowBranchToBranchTraffic = allowBranchToBranchTraffic; - PreferredRoutingGateway = preferredRoutingGateway; Etag = etag; CustomInit(); } @@ -222,13 +218,6 @@ public VirtualHub() [JsonProperty(PropertyName = "properties.allowBranchToBranchTraffic")] public bool? AllowBranchToBranchTraffic { get; set; } - /// - /// Gets or sets the preferred gateway to route on-prem traffic. - /// Possible values include: 'ExpressRoute', 'VpnGateway', 'None' - /// - [JsonProperty(PropertyName = "properties.preferredRoutingGateway")] - public string PreferredRoutingGateway { 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/VirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs index 6b7af986bcc5..3643f4bb762e 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 @@ -46,8 +46,6 @@ public VirtualNetwork() /// The dhcpOptions that contains an array of /// DNS servers available to VMs deployed in the virtual /// network. - /// The FlowTimeout value (in - /// minutes) for the Virtual Network /// A list of subnets in a Virtual /// Network. /// A list of peerings in a @@ -71,13 +69,12 @@ public VirtualNetwork() /// this VNET. /// A unique read-only string that changes whenever /// the resource is updated. - public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), int? flowTimeoutInMinutes = default(int?), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), VirtualNetworkBgpCommunities bgpCommunities = default(VirtualNetworkBgpCommunities), IList ipAllocations = default(IList), string etag = default(string)) + public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), VirtualNetworkBgpCommunities bgpCommunities = default(VirtualNetworkBgpCommunities), IList ipAllocations = default(IList), string etag = default(string)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; AddressSpace = addressSpace; DhcpOptions = dhcpOptions; - FlowTimeoutInMinutes = flowTimeoutInMinutes; Subnets = subnets; VirtualNetworkPeerings = virtualNetworkPeerings; ResourceGuid = resourceGuid; @@ -116,13 +113,6 @@ public VirtualNetwork() [JsonProperty(PropertyName = "properties.dhcpOptions")] public DhcpOptions DhcpOptions { get; set; } - /// - /// Gets or sets the FlowTimeout value (in minutes) for the Virtual - /// Network - /// - [JsonProperty(PropertyName = "properties.flowTimeoutInMinutes")] - public int? FlowTimeoutInMinutes { get; set; } - /// /// Gets or sets a list of subnets in a Virtual Network. /// @@ -199,6 +189,10 @@ public VirtualNetwork() /// public virtual void Validate() { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } if (VirtualNetworkPeerings != null) { foreach (var element in VirtualNetworkPeerings) 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 7d4dc21f492c..0d055075c65d 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 @@ -39,6 +39,8 @@ public VirtualNetworkGateway() /// Resource type. /// Resource location. /// Resource tags. + /// The extended location of type local + /// virtual network gateway. /// IP configurations for virtual /// network gateway. /// The type of this virtual network gateway. @@ -82,18 +84,12 @@ public VirtualNetworkGateway() /// Customer vnet resource /// id. VirtualNetworkGateway of type local gateway is associated with /// the customer vnet. - /// NatRules for virtual network - /// gateway. - /// EnableBgpRouteTranslationForNat - /// flag. - /// The extended location of type local - /// virtual network gateway. /// A unique read-only string that changes whenever /// the resource is updated. - public VirtualNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList ipConfigurations = default(IList), string gatewayType = default(string), string vpnType = default(string), string vpnGatewayGeneration = default(string), bool? enableBgp = default(bool?), bool? enablePrivateIpAddress = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), AddressSpace customRoutes = default(AddressSpace), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDnsForwarding = default(bool?), string inboundDnsForwardingEndpoint = default(string), string vNetExtendedLocationResourceId = default(string), IList natRules = default(IList), bool? enableBgpRouteTranslationForNat = default(bool?), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string)) + public VirtualNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExtendedLocation extendedLocation = default(ExtendedLocation), IList ipConfigurations = default(IList), string gatewayType = default(string), string vpnType = default(string), string vpnGatewayGeneration = default(string), bool? enableBgp = default(bool?), bool? enablePrivateIpAddress = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), AddressSpace customRoutes = default(AddressSpace), string resourceGuid = default(string), string provisioningState = default(string), bool? enableDnsForwarding = default(bool?), string inboundDnsForwardingEndpoint = default(string), string vNetExtendedLocationResourceId = default(string), string etag = default(string)) : base(id, name, type, location, tags) { + ExtendedLocation = extendedLocation; IpConfigurations = ipConfigurations; GatewayType = gatewayType; VpnType = vpnType; @@ -111,9 +107,6 @@ public VirtualNetworkGateway() EnableDnsForwarding = enableDnsForwarding; InboundDnsForwardingEndpoint = inboundDnsForwardingEndpoint; VNetExtendedLocationResourceId = vNetExtendedLocationResourceId; - NatRules = natRules; - EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; - ExtendedLocation = extendedLocation; Etag = etag; CustomInit(); } @@ -123,6 +116,13 @@ public VirtualNetworkGateway() /// partial void CustomInit(); + /// + /// Gets or sets the extended location of type local virtual network + /// gateway. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Gets or sets IP configurations for virtual network gateway. /// @@ -242,25 +242,6 @@ public VirtualNetworkGateway() [JsonProperty(PropertyName = "properties.vNetExtendedLocationResourceId")] public string VNetExtendedLocationResourceId { get; set; } - /// - /// Gets or sets natRules for virtual network gateway. - /// - [JsonProperty(PropertyName = "properties.natRules")] - public IList NatRules { get; set; } - - /// - /// Gets or sets enableBgpRouteTranslationForNat flag. - /// - [JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] - public bool? EnableBgpRouteTranslationForNat { get; set; } - - /// - /// Gets or sets the extended location of type local virtual network - /// gateway. - /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -276,6 +257,10 @@ public VirtualNetworkGateway() /// public virtual void Validate() { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } if (BgpSettings != null) { BgpSettings.Validate(); 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 467f31a4a4b3..099f51438b2d 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 @@ -29,6 +29,7 @@ public partial class VirtualNetworkGatewayConnection : Resource /// public VirtualNetworkGatewayConnection() { + VirtualNetworkGateway1 = new VirtualNetworkGateway(); CustomInit(); } @@ -51,8 +52,6 @@ public VirtualNetworkGatewayConnection() /// network gateway resource. /// The reference to local network /// gateway resource. - /// List of ingress NatRules. - /// List of egress NatRules. /// Connection protocol used for this /// connection. Possible values include: 'IKEv2', 'IKEv1' /// The routing weight. @@ -90,15 +89,13 @@ public VirtualNetworkGatewayConnection() /// for data forwarding. /// A unique read-only string that changes whenever /// the resource is updated. - public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), IList ingressNatRules = default(IList), IList egressNatRules = default(IList), string connectionProtocol = default(string), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), bool? useLocalAzureIpAddress = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), IList trafficSelectorPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), string etag = default(string)) + public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), string connectionProtocol = default(string), int? routingWeight = default(int?), int? dpdTimeoutSeconds = default(int?), string connectionMode = default(string), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), bool? useLocalAzureIpAddress = default(bool?), bool? usePolicyBasedTrafficSelectors = default(bool?), IList ipsecPolicies = default(IList), IList trafficSelectorPolicies = default(IList), string resourceGuid = default(string), string provisioningState = default(string), bool? expressRouteGatewayBypass = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; VirtualNetworkGateway1 = virtualNetworkGateway1; VirtualNetworkGateway2 = virtualNetworkGateway2; LocalNetworkGateway2 = localNetworkGateway2; - IngressNatRules = ingressNatRules; - EgressNatRules = egressNatRules; ConnectionType = connectionType; ConnectionProtocol = connectionProtocol; RoutingWeight = routingWeight; @@ -151,18 +148,6 @@ public VirtualNetworkGatewayConnection() [JsonProperty(PropertyName = "properties.localNetworkGateway2")] public LocalNetworkGateway LocalNetworkGateway2 { get; set; } - /// - /// Gets or sets list of ingress NatRules. - /// - [JsonProperty(PropertyName = "properties.ingressNatRules")] - public IList IngressNatRules { get; set; } - - /// - /// Gets or sets list of egress NatRules. - /// - [JsonProperty(PropertyName = "properties.egressNatRules")] - public IList EgressNatRules { get; set; } - /// /// Gets or sets gateway connection type. Possible values include: /// 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' 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 similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs deleted file mode 100644 index f869335babac..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights 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; - - /// - /// VirtualNetworkGatewayNatRule Resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class VirtualNetworkGatewayNatRule : SubResource - { - /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRule - /// class. - /// - public VirtualNetworkGatewayNatRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRule - /// class. - /// - /// Resource ID. - /// The provisioning state of the NAT - /// Rule resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The type - /// of NAT rule for VPN NAT. Possible values include: 'Static', - /// 'Dynamic' - /// The Source NAT direction of a VPN NAT. Possible - /// values include: 'EgressSnat', 'IngressSnat' - /// The private IP address internal - /// mapping for NAT. - /// The private IP address external - /// mapping for NAT. - /// The IP Configuration ID this NAT - /// rule applies to. - /// 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. - /// Resource type. - public VirtualNetworkGatewayNatRule(string id = default(string), string provisioningState = default(string), string virtualNetworkGatewayNatRulePropertiesType = default(string), string mode = default(string), IList internalMappings = default(IList), IList externalMappings = default(IList), string ipConfigurationId = default(string), string name = default(string), string etag = default(string), string type = default(string)) - : base(id) - { - ProvisioningState = provisioningState; - VirtualNetworkGatewayNatRulePropertiesType = virtualNetworkGatewayNatRulePropertiesType; - Mode = mode; - InternalMappings = internalMappings; - ExternalMappings = externalMappings; - IpConfigurationId = ipConfigurationId; - Name = name; - Etag = etag; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the provisioning state of the NAT Rule resource. Possible - /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the type of NAT rule for VPN NAT. Possible values - /// include: 'Static', 'Dynamic' - /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualNetworkGatewayNatRulePropertiesType { get; set; } - - /// - /// Gets or sets the Source NAT direction of a VPN NAT. Possible values - /// include: 'EgressSnat', 'IngressSnat' - /// - [JsonProperty(PropertyName = "properties.mode")] - public string Mode { get; set; } - - /// - /// Gets or sets the private IP address internal mapping for NAT. - /// - [JsonProperty(PropertyName = "properties.internalMappings")] - public IList InternalMappings { get; set; } - - /// - /// Gets or sets the private IP address external mapping for NAT. - /// - [JsonProperty(PropertyName = "properties.externalMappings")] - public IList ExternalMappings { get; set; } - - /// - /// Gets or sets the IP Configuration ID this NAT rule applies to. - /// - [JsonProperty(PropertyName = "properties.ipConfigurationId")] - public string IpConfigurationId { get; set; } - - /// - /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets resource type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { 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 23b92cca42f4..03b45c99a365 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 @@ -52,19 +52,13 @@ public VirtualNetworkPeering() /// different region (preview). See here to register for the preview /// and learn more /// (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - /// The reference to the address space - /// peered with the remote virtual network. - /// The reference to the - /// current address space of the remote virtual network. + /// The reference to the remote + /// virtual network address space. /// The reference to the remote /// virtual network's Bgp Communities. /// The status of the virtual network /// peering. Possible values include: 'Initiated', 'Connected', /// 'Disconnected' - /// The peering sync status of the - /// virtual network peering. Possible values include: 'FullyInSync', - /// 'RemoteNotInSync', 'LocalNotInSync', - /// 'LocalAndRemoteNotInSync' /// The provisioning state of the /// virtual network peering resource. Possible values include: /// 'Succeeded', 'Updating', 'Deleting', 'Failed' @@ -78,7 +72,7 @@ public VirtualNetworkPeering() /// A unique read-only string that changes whenever /// the resource is updated. /// Resource type. - public VirtualNetworkPeering(string id = default(string), bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), AddressSpace remoteAddressSpace = default(AddressSpace), AddressSpace remoteVirtualNetworkAddressSpace = default(AddressSpace), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), string peeringState = default(string), string peeringSyncLevel = default(string), string provisioningState = default(string), bool? doNotVerifyRemoteGateways = default(bool?), string resourceGuid = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public VirtualNetworkPeering(string id = default(string), bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), AddressSpace remoteAddressSpace = default(AddressSpace), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), string peeringState = default(string), string provisioningState = default(string), bool? doNotVerifyRemoteGateways = default(bool?), string resourceGuid = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { AllowVirtualNetworkAccess = allowVirtualNetworkAccess; @@ -87,10 +81,8 @@ public VirtualNetworkPeering() UseRemoteGateways = useRemoteGateways; RemoteVirtualNetwork = remoteVirtualNetwork; RemoteAddressSpace = remoteAddressSpace; - RemoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; RemoteBgpCommunities = remoteBgpCommunities; PeeringState = peeringState; - PeeringSyncLevel = peeringSyncLevel; ProvisioningState = provisioningState; DoNotVerifyRemoteGateways = doNotVerifyRemoteGateways; ResourceGuid = resourceGuid; @@ -148,19 +140,12 @@ public VirtualNetworkPeering() public SubResource RemoteVirtualNetwork { get; set; } /// - /// Gets or sets the reference to the address space peered with the - /// remote virtual network. + /// Gets or sets the reference to the remote virtual network address + /// space. /// [JsonProperty(PropertyName = "properties.remoteAddressSpace")] public AddressSpace RemoteAddressSpace { get; set; } - /// - /// Gets or sets the reference to the current address space of the - /// remote virtual network. - /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetworkAddressSpace")] - public AddressSpace RemoteVirtualNetworkAddressSpace { get; set; } - /// /// Gets or sets the reference to the remote virtual network's Bgp /// Communities. @@ -175,14 +160,6 @@ public VirtualNetworkPeering() [JsonProperty(PropertyName = "properties.peeringState")] public string PeeringState { get; set; } - /// - /// Gets or sets the peering sync status of the virtual network - /// peering. Possible values include: 'FullyInSync', 'RemoteNotInSync', - /// 'LocalNotInSync', 'LocalAndRemoteNotInSync' - /// - [JsonProperty(PropertyName = "properties.peeringSyncLevel")] - public string PeeringSyncLevel { get; set; } - /// /// Gets the provisioning state of the virtual network peering /// resource. Possible values include: 'Succeeded', 'Updating', diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs deleted file mode 100644 index 4ba41da779d6..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - - /// - /// Defines values for VirtualNetworkPeeringLevel. - /// - public static class VirtualNetworkPeeringLevel - { - public const string FullyInSync = "FullyInSync"; - public const string RemoteNotInSync = "RemoteNotInSync"; - public const string LocalNotInSync = "LocalNotInSync"; - public const string LocalAndRemoteNotInSync = "LocalAndRemoteNotInSync"; - } -} 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 fae7eacd4bbb..18f6870e7822 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 @@ -125,5 +125,32 @@ public VirtualNetworkTap() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkInterfaceTapConfigurations != null) + { + foreach (var element in NetworkInterfaceTapConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (DestinationNetworkInterfaceIPConfiguration != null) + { + DestinationNetworkInterfaceIPConfiguration.Validate(); + } + if (DestinationLoadBalancerFrontEndIPConfiguration != null) + { + DestinationLoadBalancerFrontEndIPConfiguration.Validate(); + } + } } } 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 5047308d8922..c0bda7c1d48f 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs index 1c4ba89045ea..f9ca5ba58ff9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs @@ -101,7 +101,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs new file mode 100644 index 000000000000..6b2ce397b763 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs @@ -0,0 +1,1096 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkGroupsOperations operations. + /// + internal partial class NetworkGroupsOperations : IServiceOperations, INetworkGroupsOperations + { + /// + /// Initializes a new instance of the NetworkGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkGroupsOperations(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 network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string networkGroupName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + 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/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a network group. + /// + /// + /// Parameters supplied to the specify which network group need to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); + 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 (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{networkGroupName}", System.Uri.EscapeDataString(networkGroupName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/networkGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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; + } + + /// + /// Lists the specified network group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..c3edfff097eb --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs @@ -0,0 +1,270 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 NetworkGroupsOperations. + /// + public static partial class NetworkGroupsOperationsExtensions + { + /// + /// Gets the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + public static NetworkGroup Get(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, networkGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the specify which network group need to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + public static NetworkGroup CreateOrUpdate(this INetworkGroupsOperations operations, NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string)) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the specify which network group need to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the + /// current resource. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INetworkGroupsOperations operations, NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + public static void Delete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this INetworkGroupsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the specified network group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this INetworkGroupsOperations 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/NetworkInterfaceIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs index e48a90a7f76d..98a25fc6ef5d 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 223c5f6b009d..83172723c07a 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 = "2021-02-01"; + string apiVersion = "2020-11-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 0fa75397f9fb..ac57ddc4581e 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,11 +736,15 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationParameters"); } + if (tapConfigurationParameters != null) + { + tapConfigurationParameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 8768ce7c3190..369b88404652 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs @@ -102,7 +102,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -298,7 +298,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -509,7 +509,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +737,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -968,7 +968,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1155,7 +1155,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1338,7 +1338,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2640,7 +2640,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2819,11 +2819,15 @@ internal NetworkInterfacesOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3042,7 +3046,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3236,7 +3240,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 c1c3a4b3a998..994ea2eaf0b0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs @@ -303,6 +303,101 @@ public partial class NetworkManagementClient : ServiceClient public virtual INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; private set; } + /// + /// Gets the INetworkManagersOperations. + /// + public virtual INetworkManagersOperations NetworkManagers { get; private set; } + + /// + /// Gets the INetworkManagerCommitsOperations. + /// + public virtual INetworkManagerCommitsOperations NetworkManagerCommits { get; private set; } + + /// + /// Gets the INetworkManagerDeploymentStatusOperations. + /// + public virtual INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; private set; } + + /// + /// Gets the IEffectiveVirtualNetworksOperations. + /// + public virtual IEffectiveVirtualNetworksOperations EffectiveVirtualNetworks { get; private set; } + + /// + /// Gets the IActiveConnectivityConfigurationsOperations. + /// + public virtual IActiveConnectivityConfigurationsOperations ActiveConnectivityConfigurations { get; private set; } + + /// + /// Gets the IActiveSecurityAdminRulesOperations. + /// + public virtual IActiveSecurityAdminRulesOperations ActiveSecurityAdminRules { get; private set; } + + /// + /// Gets the IActiveSecurityUserRulesOperations. + /// + public virtual IActiveSecurityUserRulesOperations ActiveSecurityUserRules { get; private set; } + + /// + /// Gets the IConnectivityConfigurationsOperations. + /// + public virtual IConnectivityConfigurationsOperations ConnectivityConfigurations { get; private set; } + + /// + /// Gets the IEffectiveConnectivityConfigurationsOperations. + /// + public virtual IEffectiveConnectivityConfigurationsOperations EffectiveConnectivityConfigurations { get; private set; } + + /// + /// Gets the INetworkManagerEffectiveSecurityAdminRulesOperations. + /// + public virtual INetworkManagerEffectiveSecurityAdminRulesOperations NetworkManagerEffectiveSecurityAdminRules { get; private set; } + + /// + /// Gets the INetworkGroupsOperations. + /// + public virtual INetworkGroupsOperations NetworkGroups { get; private set; } + + /// + /// Gets the ISecurityUserConfigurationsOperations. + /// + public virtual ISecurityUserConfigurationsOperations SecurityUserConfigurations { get; private set; } + + /// + /// Gets the IUserRuleCollectionsOperations. + /// + public virtual IUserRuleCollectionsOperations UserRuleCollections { get; private set; } + + /// + /// Gets the IUserRulesOperations. + /// + public virtual IUserRulesOperations UserRules { get; private set; } + + /// + /// Gets the ISecurityAdminConfigurationsOperations. + /// + public virtual ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; private set; } + + /// + /// Gets the IAdminRuleCollectionsOperations. + /// + public virtual IAdminRuleCollectionsOperations AdminRuleCollections { get; private set; } + + /// + /// Gets the IAdminRulesOperations. + /// + public virtual IAdminRulesOperations AdminRules { get; private set; } + + /// + /// Gets the INetworkSecurityPerimetersOperations. + /// + public virtual INetworkSecurityPerimetersOperations NetworkSecurityPerimeters { get; private set; } + + /// + /// Gets the IPerimeterAssociableResourceTypesOperations. + /// + public virtual IPerimeterAssociableResourceTypesOperations PerimeterAssociableResourceTypes { get; private set; } + /// /// Gets the INetworkProfilesOperations. /// @@ -483,11 +578,6 @@ public partial class NetworkManagementClient : ServiceClient public virtual ILocalNetworkGatewaysOperations LocalNetworkGateways { get; private set; } - /// - /// Gets the IVirtualNetworkGatewayNatRulesOperations. - /// - public virtual IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; private set; } - /// /// Gets the IVirtualNetworkTapsOperations. /// @@ -899,6 +989,25 @@ private void Initialize() NetworkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsOperations(this); NetworkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersOperations(this); NetworkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsOperations(this); + NetworkManagers = new NetworkManagersOperations(this); + NetworkManagerCommits = new NetworkManagerCommitsOperations(this); + NetworkManagerDeploymentStatus = new NetworkManagerDeploymentStatusOperations(this); + EffectiveVirtualNetworks = new EffectiveVirtualNetworksOperations(this); + ActiveConnectivityConfigurations = new ActiveConnectivityConfigurationsOperations(this); + ActiveSecurityAdminRules = new ActiveSecurityAdminRulesOperations(this); + ActiveSecurityUserRules = new ActiveSecurityUserRulesOperations(this); + ConnectivityConfigurations = new ConnectivityConfigurationsOperations(this); + EffectiveConnectivityConfigurations = new EffectiveConnectivityConfigurationsOperations(this); + NetworkManagerEffectiveSecurityAdminRules = new NetworkManagerEffectiveSecurityAdminRulesOperations(this); + NetworkGroups = new NetworkGroupsOperations(this); + SecurityUserConfigurations = new SecurityUserConfigurationsOperations(this); + UserRuleCollections = new UserRuleCollectionsOperations(this); + UserRules = new UserRulesOperations(this); + SecurityAdminConfigurations = new SecurityAdminConfigurationsOperations(this); + AdminRuleCollections = new AdminRuleCollectionsOperations(this); + AdminRules = new AdminRulesOperations(this); + NetworkSecurityPerimeters = new NetworkSecurityPerimetersOperations(this); + PerimeterAssociableResourceTypes = new PerimeterAssociableResourceTypesOperations(this); NetworkProfiles = new NetworkProfilesOperations(this); NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); SecurityRules = new SecurityRulesOperations(this); @@ -935,7 +1044,6 @@ private void Initialize() VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); - VirtualNetworkGatewayNatRules = new VirtualNetworkGatewayNatRulesOperations(this); VirtualNetworkTaps = new VirtualNetworkTapsOperations(this); VirtualRouters = new VirtualRoutersOperations(this); VirtualRouterPeerings = new VirtualRouterPeeringsOperations(this); @@ -995,6 +1103,16 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleCollectionType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); @@ -1102,7 +1220,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1332,7 +1450,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "sessionIds"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1535,7 +1653,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1733,7 +1851,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1963,7 +2081,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2169,7 +2287,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2352,7 +2470,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2557,7 +2675,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "vpnClientParams"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs new file mode 100644 index 000000000000..48a740a23c13 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkManagerCommitsOperations operations. + /// + internal partial class NetworkManagerCommitsOperations : IServiceOperations, INetworkManagerCommitsOperations + { + /// + /// Initializes a new instance of the NetworkManagerCommitsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagerCommitsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Post a Network Manager Commit. + /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Post", 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/networkManagers/{networkManagerName}/commit").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs new file mode 100644 index 000000000000..35f1b26a59e6 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NetworkManagerCommitsOperations. + /// + public static partial class NetworkManagerCommitsOperationsExtensions + { + /// + /// Post a Network Manager Commit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManagerCommit Post(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName) + { + return operations.PostAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Post a Network Manager Commit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to specify which Managed Network commit is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task PostAsync(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs new file mode 100644 index 000000000000..f078bf5cfe9b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkManagerDeploymentStatusOperations operations. + /// + internal partial class NetworkManagerDeploymentStatusOperations : IServiceOperations, INetworkManagerDeploymentStatusOperations + { + /// + /// Initializes a new instance of the NetworkManagerDeploymentStatusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// Parameters supplied to specify which Managed Network deployment status is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + 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/networkManagers/{networkManagerName}/listDeploymentStatus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/NetworkManagerDeploymentStatusOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs new file mode 100644 index 000000000000..e5c36f86ffe3 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NetworkManagerDeploymentStatusOperations. + /// + public static partial class NetworkManagerDeploymentStatusOperationsExtensions + { + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to specify which Managed Network deployment status is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManagerDeploymentStatusListResult List(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName) + { + return operations.ListAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to specify which Managed Network deployment status is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..0aaed7494ff9 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkManagerEffectiveSecurityAdminRulesOperations operations. + /// + internal partial class NetworkManagerEffectiveSecurityAdminRulesOperations : IServiceOperations, INetworkManagerEffectiveSecurityAdminRulesOperations + { + /// + /// Initializes a new instance of the NetworkManagerEffectiveSecurityAdminRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagerEffectiveSecurityAdminRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 virtualNetworkName, object 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 (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + 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/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + 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/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs new file mode 100644 index 000000000000..d1e4f7243c37 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NetworkManagerEffectiveSecurityAdminRulesOperations. + /// + public static partial class NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions + { + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + public static NetworkManagerEffectiveSecurityAdminRulesListResult List(this INetworkManagerEffectiveSecurityAdminRulesOperations operations, string resourceGroupName, string virtualNetworkName, object parameters) + { + return operations.ListAsync(resourceGroupName, virtualNetworkName, parameters).GetAwaiter().GetResult(); + } + + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this INetworkManagerEffectiveSecurityAdminRulesOperations operations, string resourceGroupName, string virtualNetworkName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs new file mode 100644 index 000000000000..35b89b579654 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs @@ -0,0 +1,1618 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkManagersOperations operations. + /// + internal partial class NetworkManagersOperations : IServiceOperations, INetworkManagersOperations + { + /// + /// Initializes a new instance of the NetworkManagersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagersOperations(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 Network Manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + 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/networkManagers/{networkManagerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Network Manager. + /// + /// + /// Parameters supplied to specify which network manager is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(NetworkManager parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Patch a NetworkManager Tags. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> PatchTagsWithHttpMessagesAsync(TagsObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchTags", 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/networkManagers/{networkManagerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + 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; + } + + /// + /// List all network managers in a subscription. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers").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 (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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; + } + + /// + /// List network managers in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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, int? top = default(int?), string skipToken = default(string), 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 (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // 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("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers").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) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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; + } + + /// + /// List all network managers 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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; + } + + /// + /// List network managers in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs new file mode 100644 index 000000000000..496cd644173f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs @@ -0,0 +1,364 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 NetworkManagersOperations. + /// + public static partial class NetworkManagersOperationsExtensions + { + /// + /// Gets the specified Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager Get(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName) + { + return operations.GetAsync(resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to specify which network manager is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager CreateOrUpdate(this INetworkManagersOperations operations, NetworkManager parameters, string resourceGroupName, string networkManagerName) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to specify which network manager is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INetworkManagersOperations operations, NetworkManager parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static void Delete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Patch a NetworkManager Tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager PatchTags(this INetworkManagersOperations operations, TagsObject parameters, string resourceGroupName, string networkManagerName) + { + return operations.PatchTagsAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Patch a NetworkManager Tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task PatchTagsAsync(this INetworkManagersOperations operations, TagsObject parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchTagsWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage ListBySubscription(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListBySubscriptionAsync(top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all network managers in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this INetworkManagersOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all network managers 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> ListBySubscriptionNextAsync(this INetworkManagersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this INetworkManagersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List network managers in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this INetworkManagersOperations 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/NetworkProfilesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs index 73b5fc667814..65963ff53836 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 7c9566158d07..775ed12380a2 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,7 +911,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs new file mode 100644 index 000000000000..534607527ec1 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs @@ -0,0 +1,1410 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// NetworkSecurityPerimetersOperations operations. + /// + internal partial class NetworkSecurityPerimetersOperations : IServiceOperations, INetworkSecurityPerimetersOperations + { + /// + /// Initializes a new instance of the NetworkSecurityPerimetersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkSecurityPerimetersOperations(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 network security perimeter by the name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkSecurityPerimeterName, 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 (networkSecurityPerimeterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); + 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/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Network Security Perimeter. + /// + /// + /// Parameter supplied to create or update the network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityPerimeterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, 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 (networkSecurityPerimeterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all network security perimeters in a subscription. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityPerimeters").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 (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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; + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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, int? top = default(int?), string skipToken = default(string), 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 (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // 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("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkSecurityPerimeters").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) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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; + } + + /// + /// List all network security perimeters 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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; + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs new file mode 100644 index 000000000000..d7d7cc00d8b1 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs @@ -0,0 +1,318 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 NetworkSecurityPerimetersOperations. + /// + public static partial class NetworkSecurityPerimetersOperationsExtensions + { + /// + /// Gets the specified network security perimeter by the name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + public static NetworkSecurityPerimeter Get(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName) + { + return operations.GetAsync(resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified network security perimeter by the name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Network Security Perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameter supplied to create or update the network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + public static NetworkSecurityPerimeter CreateOrUpdate(this INetworkSecurityPerimetersOperations operations, NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Network Security Perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameter supplied to create or update the network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INetworkSecurityPerimetersOperations operations, NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network security perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + public static void Delete(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName) + { + operations.DeleteAsync(resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network security perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all network security perimeters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage ListBySubscription(this INetworkSecurityPerimetersOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListBySubscriptionAsync(top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all network security perimeters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this INetworkSecurityPerimetersOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all network security perimeters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this INetworkSecurityPerimetersOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all network security perimeters 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> ListBySubscriptionNextAsync(this INetworkSecurityPerimetersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this INetworkSecurityPerimetersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this INetworkSecurityPerimetersOperations 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/NetworkVirtualAppliancesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs index a58411d73f9b..88f8a92542c6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs @@ -119,7 +119,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 df9c8e8763b8..38264005c714 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1571,7 +1571,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1754,7 +1754,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1979,7 +1979,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2204,7 +2204,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2429,7 +2429,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2654,7 +2654,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2880,7 +2880,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3107,7 +3107,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3334,7 +3334,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3561,7 +3561,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3784,7 +3784,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4015,7 +4015,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 ef83ab22ca71..299057dabd84 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 = "2021-02-01"; + string apiVersion = "2020-11-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 befd48a49a54..1289afa50d22 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -532,7 +532,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -854,7 +854,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,7 +1080,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1278,7 +1278,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1454,7 +1454,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1657,7 +1657,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1859,7 +1859,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2061,7 +2061,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2267,7 +2267,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 009646758e72..05fd5906fd7d 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 2225543ad01f..d43a7a8e7365 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs new file mode 100644 index 000000000000..769ce24d4b09 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs @@ -0,0 +1,240 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// PerimeterAssociableResourceTypesOperations operations. + /// + internal partial class PerimeterAssociableResourceTypesOperations : IServiceOperations, IPerimeterAssociableResourceTypesOperations + { + /// + /// Initializes a new instance of the PerimeterAssociableResourceTypesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PerimeterAssociableResourceTypesOperations(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 list of resources that are onboarded with NSP. These resources can + /// be associated with a network security perimeter + /// + /// + /// The location of the where the association is present. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + 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}/providers/Microsoft.Network/locations/{location}/perimeterAssociableResourceTypes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + 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; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs new file mode 100644 index 000000000000..9b60f7b572b9 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 PerimeterAssociableResourceTypesOperations. + /// + public static partial class PerimeterAssociableResourceTypesOperationsExtensions + { + /// + /// Gets the list of resources that are onboarded with NSP. These resources can + /// be associated with a network security perimeter + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the where the association is present. + /// + public static PerimeterAssociableResourcesListResult Get(this IPerimeterAssociableResourceTypesOperations operations, string location) + { + return operations.GetAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of resources that are onboarded with NSP. These resources can + /// be associated with a network security perimeter + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the where the association is present. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPerimeterAssociableResourceTypesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs index c60d36c32fed..8b98c61ef4e1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs @@ -127,7 +127,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -740,7 +740,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 6a06e26e8be6..021b83888e81 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -860,11 +860,15 @@ internal PrivateEndpointsOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-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 abdd8399e42d..21734e8da396 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -700,7 +700,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -907,11 +907,15 @@ internal PrivateLinkServicesOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1139,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1366,7 +1370,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1559,7 +1563,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1750,7 +1754,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1924,11 +1928,15 @@ internal PrivateLinkServicesOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2147,7 +2155,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2320,7 +2328,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2527,7 +2535,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs similarity index 99% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs index c4a05c889a6a..c265be1086b8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs @@ -94,7 +94,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -310,7 +310,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -541,7 +541,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,7 +773,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1004,7 +1004,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1191,7 +1191,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1374,7 +1374,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2218,7 +2218,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2397,11 +2397,15 @@ internal PublicIPAddressesOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperationsExtensions.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperationsExtensions.cs 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 63883ffdea67..dc38cc3f1d64 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,11 +1088,15 @@ internal PublicIPPrefixesOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 304cb0c019c0..c25d53ab6ef8 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 = "2021-02-01"; + string apiVersion = "2020-11-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 ae78dd7c205a..27c88f37e919 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 c24feb97191d..ea4e5f2f4187 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 bb44a08db3fb..d9d70170100b 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 859fa569b081..a05e63697750 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 277062fb225a..eae8ba3a9017 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 @@ -20,138 +20,145 @@ public static IEnumerable> ApiInfo_NetworkManageme return new Tuple[] { new Tuple("Compute", "NetworkInterfaces", "2018-10-01"), - new Tuple("Compute", "NetworkInterfaces", "2021-02-01"), + new Tuple("Compute", "NetworkInterfaces", "2020-11-01"), new Tuple("Compute", "PublicIPAddresses", "2018-10-01"), - new Tuple("Compute", "PublicIPAddresses", "2021-02-01"), - new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2021-02-01"), - new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2021-02-01"), - new Tuple("Network", "ApplicationGateways", "2021-02-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2021-02-01"), - new Tuple("Network", "AvailableDelegations", "2021-02-01"), - new Tuple("Network", "AvailableEndpointServices", "2021-02-01"), - new Tuple("Network", "AvailablePrivateEndpointTypes", "2021-02-01"), - new Tuple("Network", "AvailableResourceGroupDelegations", "2021-02-01"), - new Tuple("Network", "AvailableServiceAliases", "2021-02-01"), - new Tuple("Network", "AzureFirewallFqdnTags", "2021-02-01"), - new Tuple("Network", "AzureFirewalls", "2021-02-01"), - new Tuple("Network", "BastionHosts", "2021-02-01"), - new Tuple("Network", "BgpServiceCommunities", "2021-02-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2021-02-01"), - new Tuple("Network", "ConnectionMonitors", "2021-02-01"), - new Tuple("Network", "CustomIPPrefixes", "2021-02-01"), - new Tuple("Network", "DdosCustomPolicies", "2021-02-01"), - new Tuple("Network", "DdosProtectionPlans", "2021-02-01"), - new Tuple("Network", "DefaultSecurityRules", "2021-02-01"), - new Tuple("Network", "DeleteBastionShareableLink", "2021-02-01"), - new Tuple("Network", "DisconnectActiveSessions", "2021-02-01"), - new Tuple("Network", "DscpConfiguration", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuits", "2021-02-01"), - new Tuple("Network", "ExpressRouteConnections", "2021-02-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2021-02-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2021-02-01"), - new Tuple("Network", "ExpressRouteGateways", "2021-02-01"), - new Tuple("Network", "ExpressRouteLinks", "2021-02-01"), - new Tuple("Network", "ExpressRoutePorts", "2021-02-01"), - new Tuple("Network", "ExpressRoutePortsLocations", "2021-02-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2021-02-01"), - new Tuple("Network", "FirewallPolicies", "2021-02-01"), - new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2021-02-01"), - new Tuple("Network", "FlowLogs", "2021-02-01"), - new Tuple("Network", "GetActiveSessions", "2021-02-01"), - new Tuple("Network", "GetBastionShareableLink", "2021-02-01"), - new Tuple("Network", "HubRouteTables", "2021-02-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2021-02-01"), - new Tuple("Network", "InboundNatRules", "2021-02-01"), - new Tuple("Network", "InboundSecurityRule", "2021-02-01"), - new Tuple("Network", "IpAllocations", "2021-02-01"), - new Tuple("Network", "IpGroups", "2021-02-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2021-02-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2021-02-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2021-02-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2021-02-01"), - new Tuple("Network", "LoadBalancerOutboundRules", "2021-02-01"), - new Tuple("Network", "LoadBalancerProbes", "2021-02-01"), - new Tuple("Network", "LoadBalancers", "2021-02-01"), - new Tuple("Network", "LocalNetworkGateways", "2021-02-01"), - new Tuple("Network", "NatGateways", "2021-02-01"), - new Tuple("Network", "NatRules", "2021-02-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2021-02-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2021-02-01"), - new Tuple("Network", "NetworkInterfaceTapConfigurations", "2021-02-01"), - new Tuple("Network", "NetworkInterfaces", "2021-02-01"), - new Tuple("Network", "NetworkProfiles", "2021-02-01"), - new Tuple("Network", "NetworkSecurityGroups", "2021-02-01"), - new Tuple("Network", "NetworkVirtualAppliances", "2021-02-01"), - new Tuple("Network", "NetworkWatchers", "2021-02-01"), - new Tuple("Network", "Operations", "2021-02-01"), - new Tuple("Network", "P2SVpnGateways", "2021-02-01"), - new Tuple("Network", "P2sVpnGateways", "2021-02-01"), - new Tuple("Network", "PacketCaptures", "2021-02-01"), - new Tuple("Network", "PeerExpressRouteCircuitConnections", "2021-02-01"), - new Tuple("Network", "PrivateDnsZoneGroups", "2021-02-01"), - new Tuple("Network", "PrivateEndpoints", "2021-02-01"), - new Tuple("Network", "PrivateLinkServices", "2021-02-01"), - new Tuple("Network", "PublicIPAddresses", "2021-02-01"), - new Tuple("Network", "PublicIPPrefixes", "2021-02-01"), - new Tuple("Network", "PutBastionShareableLink", "2021-02-01"), - new Tuple("Network", "ResourceNavigationLinks", "2021-02-01"), - new Tuple("Network", "RouteFilterRules", "2021-02-01"), - new Tuple("Network", "RouteFilters", "2021-02-01"), - new Tuple("Network", "RouteTables", "2021-02-01"), - new Tuple("Network", "Routes", "2021-02-01"), - new Tuple("Network", "SecurityPartnerProviders", "2021-02-01"), - new Tuple("Network", "SecurityRules", "2021-02-01"), - new Tuple("Network", "ServiceAssociationLinks", "2021-02-01"), - new Tuple("Network", "ServiceEndpointPolicies", "2021-02-01"), - new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2021-02-01"), - new Tuple("Network", "ServiceTags", "2021-02-01"), - new Tuple("Network", "Subnets", "2021-02-01"), - new Tuple("Network", "SupportedSecurityProviders", "2021-02-01"), - new Tuple("Network", "Usages", "2021-02-01"), - new Tuple("Network", "VirtualApplianceSites", "2021-02-01"), - new Tuple("Network", "VirtualApplianceSkus", "2021-02-01"), - new Tuple("Network", "VirtualHubBgpConnection", "2021-02-01"), - new Tuple("Network", "VirtualHubBgpConnections", "2021-02-01"), - new Tuple("Network", "VirtualHubIpConfiguration", "2021-02-01"), - new Tuple("Network", "VirtualHubRouteTableV2s", "2021-02-01"), - new Tuple("Network", "VirtualHubs", "2021-02-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2021-02-01"), - new Tuple("Network", "VirtualNetworkGatewayNatRules", "2021-02-01"), - new Tuple("Network", "VirtualNetworkGateways", "2021-02-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2021-02-01"), - new Tuple("Network", "VirtualNetworkTaps", "2021-02-01"), - new Tuple("Network", "VirtualNetworks", "2021-02-01"), - new Tuple("Network", "VirtualRouterPeerings", "2021-02-01"), - new Tuple("Network", "VirtualRouters", "2021-02-01"), - new Tuple("Network", "VirtualWans", "2021-02-01"), - new Tuple("Network", "VpnConnections", "2021-02-01"), - new Tuple("Network", "VpnGateways", "2021-02-01"), - new Tuple("Network", "VpnLinkConnections", "2021-02-01"), - new Tuple("Network", "VpnServerConfigurations", "2021-02-01"), - new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2021-02-01"), - new Tuple("Network", "VpnSiteLinkConnections", "2021-02-01"), - new Tuple("Network", "VpnSiteLinks", "2021-02-01"), - new Tuple("Network", "VpnSites", "2021-02-01"), - new Tuple("Network", "VpnSitesConfiguration", "2021-02-01"), - new Tuple("Network", "WebApplicationFirewallPolicies", "2021-02-01"), - new Tuple("Network", "WebCategories", "2021-02-01"), - new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2021-02-01"), + new Tuple("Compute", "PublicIPAddresses", "2020-11-01"), + new Tuple("Network", "ActiveConnectivityConfigurations", "2021-02-01-preview"), + new Tuple("Network", "ActiveSecurityAdminRules", "2021-02-01-preview"), + new Tuple("Network", "ActiveSecurityUserRules", "2021-02-01-preview"), + new Tuple("Network", "AdminRuleCollections", "2021-02-01-preview"), + new Tuple("Network", "AdminRules", "2021-02-01-preview"), + new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2020-11-01"), + new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2020-11-01"), + new Tuple("Network", "ApplicationGateways", "2020-11-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2020-11-01"), + new Tuple("Network", "AvailableDelegations", "2020-11-01"), + new Tuple("Network", "AvailableEndpointServices", "2020-11-01"), + new Tuple("Network", "AvailablePrivateEndpointTypes", "2020-11-01"), + new Tuple("Network", "AvailableResourceGroupDelegations", "2020-11-01"), + new Tuple("Network", "AvailableServiceAliases", "2020-11-01"), + new Tuple("Network", "AzureFirewallFqdnTags", "2020-11-01"), + new Tuple("Network", "AzureFirewalls", "2020-11-01"), + new Tuple("Network", "BastionHosts", "2020-11-01"), + new Tuple("Network", "BgpServiceCommunities", "2020-11-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2020-11-01"), + new Tuple("Network", "ConnectionMonitors", "2020-11-01"), + new Tuple("Network", "ConnectivityConfigurations", "2021-02-01-preview"), + new Tuple("Network", "CustomIPPrefixes", "2020-11-01"), + new Tuple("Network", "DdosCustomPolicies", "2020-11-01"), + new Tuple("Network", "DdosProtectionPlans", "2020-11-01"), + new Tuple("Network", "DefaultSecurityRules", "2020-11-01"), + new Tuple("Network", "DeleteBastionShareableLink", "2020-11-01"), + new Tuple("Network", "DisconnectActiveSessions", "2020-11-01"), + new Tuple("Network", "DscpConfiguration", "2020-11-01"), + new Tuple("Network", "EffectiveConnectivityConfigurations", "2021-02-01-preview"), + new Tuple("Network", "EffectiveVirtualNetworks", "2021-02-01-preview"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2020-11-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2020-11-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2020-11-01"), + new Tuple("Network", "ExpressRouteCircuits", "2020-11-01"), + new Tuple("Network", "ExpressRouteConnections", "2020-11-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2020-11-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2020-11-01"), + new Tuple("Network", "ExpressRouteGateways", "2020-11-01"), + new Tuple("Network", "ExpressRouteLinks", "2020-11-01"), + new Tuple("Network", "ExpressRoutePorts", "2020-11-01"), + new Tuple("Network", "ExpressRoutePortsLocations", "2020-11-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2020-11-01"), + new Tuple("Network", "FirewallPolicies", "2020-11-01"), + new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2020-11-01"), + new Tuple("Network", "FlowLogs", "2020-11-01"), + new Tuple("Network", "GetActiveSessions", "2020-11-01"), + new Tuple("Network", "GetBastionShareableLink", "2020-11-01"), + new Tuple("Network", "HubRouteTables", "2020-11-01"), + new Tuple("Network", "HubVirtualNetworkConnections", "2020-11-01"), + new Tuple("Network", "InboundNatRules", "2020-11-01"), + new Tuple("Network", "InboundSecurityRule", "2020-11-01"), + new Tuple("Network", "IpAllocations", "2020-11-01"), + new Tuple("Network", "IpGroups", "2020-11-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2020-11-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2020-11-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2020-11-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2020-11-01"), + new Tuple("Network", "LoadBalancerOutboundRules", "2020-11-01"), + new Tuple("Network", "LoadBalancerProbes", "2020-11-01"), + new Tuple("Network", "LoadBalancers", "2020-11-01"), + new Tuple("Network", "LocalNetworkGateways", "2020-11-01"), + new Tuple("Network", "NatGateways", "2020-11-01"), + new Tuple("Network", "NatRules", "2020-11-01"), + new Tuple("Network", "NetworkGroups", "2021-02-01-preview"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2020-11-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2020-11-01"), + new Tuple("Network", "NetworkInterfaceTapConfigurations", "2020-11-01"), + new Tuple("Network", "NetworkInterfaces", "2020-11-01"), + new Tuple("Network", "NetworkManagerCommits", "2021-02-01-preview"), + new Tuple("Network", "NetworkManagerDeploymentStatus", "2021-02-01-preview"), + new Tuple("Network", "NetworkManagerEffectiveSecurityAdminRules", "2021-02-01-preview"), + new Tuple("Network", "NetworkManagers", "2021-02-01-preview"), + new Tuple("Network", "NetworkProfiles", "2020-11-01"), + new Tuple("Network", "NetworkSecurityGroups", "2020-11-01"), + new Tuple("Network", "NetworkSecurityPerimeters", "2021-02-01-preview"), + new Tuple("Network", "NetworkVirtualAppliances", "2020-11-01"), + new Tuple("Network", "NetworkWatchers", "2020-11-01"), + new Tuple("Network", "Operations", "2020-11-01"), + new Tuple("Network", "P2SVpnGateways", "2020-11-01"), + new Tuple("Network", "P2sVpnGateways", "2020-11-01"), + new Tuple("Network", "PacketCaptures", "2020-11-01"), + new Tuple("Network", "PeerExpressRouteCircuitConnections", "2020-11-01"), + new Tuple("Network", "PerimeterAssociableResourceTypes", "2021-02-01-preview"), + new Tuple("Network", "PrivateDnsZoneGroups", "2020-11-01"), + new Tuple("Network", "PrivateEndpoints", "2020-11-01"), + new Tuple("Network", "PrivateLinkServices", "2020-11-01"), + new Tuple("Network", "PublicIPAddresses", "2020-11-01"), + new Tuple("Network", "PublicIPPrefixes", "2020-11-01"), + new Tuple("Network", "PutBastionShareableLink", "2020-11-01"), + new Tuple("Network", "ResourceNavigationLinks", "2020-11-01"), + new Tuple("Network", "RouteFilterRules", "2020-11-01"), + new Tuple("Network", "RouteFilters", "2020-11-01"), + new Tuple("Network", "RouteTables", "2020-11-01"), + new Tuple("Network", "Routes", "2020-11-01"), + new Tuple("Network", "SecurityAdminConfigurations", "2021-02-01-preview"), + new Tuple("Network", "SecurityPartnerProviders", "2020-11-01"), + new Tuple("Network", "SecurityRules", "2020-11-01"), + new Tuple("Network", "SecurityUserConfigurations", "2021-02-01-preview"), + new Tuple("Network", "ServiceAssociationLinks", "2020-11-01"), + new Tuple("Network", "ServiceEndpointPolicies", "2020-11-01"), + new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2020-11-01"), + new Tuple("Network", "ServiceTags", "2020-11-01"), + new Tuple("Network", "Subnets", "2020-11-01"), + new Tuple("Network", "SupportedSecurityProviders", "2020-11-01"), + new Tuple("Network", "Usages", "2020-11-01"), + new Tuple("Network", "UserRuleCollections", "2021-02-01-preview"), + new Tuple("Network", "UserRules", "2021-02-01-preview"), + new Tuple("Network", "VirtualApplianceSites", "2020-11-01"), + new Tuple("Network", "VirtualApplianceSkus", "2020-11-01"), + new Tuple("Network", "VirtualHubBgpConnection", "2020-11-01"), + new Tuple("Network", "VirtualHubBgpConnections", "2020-11-01"), + new Tuple("Network", "VirtualHubIpConfiguration", "2020-11-01"), + new Tuple("Network", "VirtualHubRouteTableV2s", "2020-11-01"), + new Tuple("Network", "VirtualHubs", "2020-11-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2020-11-01"), + new Tuple("Network", "VirtualNetworkGateways", "2020-11-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2020-11-01"), + new Tuple("Network", "VirtualNetworkTaps", "2020-11-01"), + new Tuple("Network", "VirtualNetworks", "2020-11-01"), + new Tuple("Network", "VirtualRouterPeerings", "2020-11-01"), + new Tuple("Network", "VirtualRouters", "2020-11-01"), + new Tuple("Network", "VirtualWans", "2020-11-01"), + new Tuple("Network", "VpnConnections", "2020-11-01"), + new Tuple("Network", "VpnGateways", "2020-11-01"), + new Tuple("Network", "VpnLinkConnections", "2020-11-01"), + new Tuple("Network", "VpnServerConfigurations", "2020-11-01"), + new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2020-11-01"), + new Tuple("Network", "VpnSiteLinkConnections", "2020-11-01"), + new Tuple("Network", "VpnSiteLinks", "2020-11-01"), + new Tuple("Network", "VpnSites", "2020-11-01"), + new Tuple("Network", "VpnSitesConfiguration", "2020-11-01"), + new Tuple("Network", "WebApplicationFirewallPolicies", "2020-11-01"), + new Tuple("Network", "WebCategories", "2020-11-01"), + new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2020-11-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - 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=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Projects\\Generator\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "f2d2a985f02c35d130bbc8b38823b1c14ae8fb4a"; - 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/SecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs new file mode 100644 index 000000000000..cc85eb728418 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs @@ -0,0 +1,1071 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SecurityAdminConfigurationsOperations operations. + /// + internal partial class SecurityAdminConfigurationsOperations : IServiceOperations, ISecurityAdminConfigurationsOperations + { + /// + /// Initializes a new instance of the SecurityAdminConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/securityAdminConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// The security admin configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (securityAdminConfiguration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityAdminConfiguration"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("securityAdminConfiguration", securityAdminConfiguration); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + 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(securityAdminConfiguration != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityAdminConfiguration, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// 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/SecurityAdminConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..9e6c84bb6c31 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs @@ -0,0 +1,264 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 SecurityAdminConfigurationsOperations. + /// + public static partial class SecurityAdminConfigurationsOperationsExtensions + { + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + public static SecurityConfiguration Get(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The security admin configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + public static SecurityConfiguration CreateOrUpdate(this ISecurityAdminConfigurationsOperations operations, SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.CreateOrUpdateAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The security admin configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISecurityAdminConfigurationsOperations operations, SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + public static void Delete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISecurityAdminConfigurationsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// 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 ISecurityAdminConfigurationsOperations 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/SecurityPartnerProvidersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs index a39cbf2e6dbd..e9e4bf35a3c0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs @@ -116,7 +116,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +902,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 37df3ef25cb9..4b344ef09d82 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs new file mode 100644 index 000000000000..e472a16237a8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs @@ -0,0 +1,1071 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SecurityUserConfigurationsOperations operations. + /// + internal partial class SecurityUserConfigurationsOperations : IServiceOperations, ISecurityUserConfigurationsOperations + { + /// + /// Initializes a new instance of the SecurityUserConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityUserConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/securityUserConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The security user configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (securityUserConfiguration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityUserConfiguration"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("securityUserConfiguration", securityUserConfiguration); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + 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(securityUserConfiguration != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityUserConfiguration, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// 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/SecurityUserConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..4f007201f322 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs @@ -0,0 +1,264 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 SecurityUserConfigurationsOperations. + /// + public static partial class SecurityUserConfigurationsOperationsExtensions + { + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + public static SecurityConfiguration Get(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The security user configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + public static SecurityConfiguration CreateOrUpdate(this ISecurityUserConfigurationsOperations operations, SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.CreateOrUpdateAsync(securityUserConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The security user configuration to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISecurityUserConfigurationsOperations operations, SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityUserConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + public static void Delete(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISecurityUserConfigurationsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// 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 ISecurityUserConfigurationsOperations 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/ServiceAssociationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs index 69bd83ea764a..cd9fc3d9e5db 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 = "2021-02-01"; + string apiVersion = "2020-11-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 69589e9f521a..3376b4e0c6e8 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -538,7 +538,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -721,7 +721,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -910,7 +910,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1094,7 +1094,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 d8e2fd2662a2..21e585af4454 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 ab8eeaed251e..fae13a4882af 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 = "2021-02-01"; + string apiVersion = "2020-11-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 e857737f5406..3253eb516493 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 cb8310631c3f..fd93aca6f982 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs new file mode 100644 index 000000000000..8fbb4e4c35fd --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs @@ -0,0 +1,1107 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// UserRuleCollectionsOperations operations. + /// + internal partial class UserRuleCollectionsOperations : IServiceOperations, IUserRuleCollectionsOperations + { + /// + /// Initializes a new instance of the UserRuleCollectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UserRuleCollectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a network manager security user configuration rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, string ruleCollectionName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a user rule collection. + /// + /// + /// The User Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (userRuleCollection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userRuleCollection"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("userRuleCollection", userRuleCollection); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + 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(userRuleCollection != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(userRuleCollection, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a user rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// 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/UserRuleCollectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs new file mode 100644 index 000000000000..b0a92257d36d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs @@ -0,0 +1,288 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 UserRuleCollectionsOperations. + /// + public static partial class UserRuleCollectionsOperationsExtensions + { + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a network manager security user configuration rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static RuleCollection Get(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a network manager security user configuration rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a user rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The User Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static RuleCollection CreateOrUpdate(this IUserRuleCollectionsOperations operations, RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.CreateOrUpdateAsync(userRuleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a user rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The User Rule Collection to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IUserRuleCollectionsOperations operations, RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(userRuleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a user rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + public static void Delete(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a user rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IUserRuleCollectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// 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 IUserRuleCollectionsOperations 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/UserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs new file mode 100644 index 000000000000..049c7d53b77d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs @@ -0,0 +1,1141 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// UserRulesOperations operations. + /// + internal partial class UserRulesOperations : IServiceOperations, IUserRulesOperations + { + /// + /// Initializes a new instance of the UserRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UserRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a user rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 networkManagerName, string configurationName, string ruleCollectionName, string ruleName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("ruleName", ruleName); + 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a user rule. + /// + /// + /// The user rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CreateOrUpdateWithHttpMessagesAsync(BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (userRule == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userRule"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("userRule", userRule); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + 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(userRule != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(userRule, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a user rule. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, 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 (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{ruleCollectionName}", System.Uri.EscapeDataString(ruleCollectionName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + 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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// 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/UserRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs new file mode 100644 index 000000000000..c062db8a3a89 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs @@ -0,0 +1,308 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 UserRulesOperations. + /// + public static partial class UserRulesOperationsExtensions + { + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + public static IPage List(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// An optional query parameter which specifies the maximum number of records + /// to be returned by the server. + /// + /// + /// SkipToken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skipToken parameter that specifies a + /// starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static BaseUserRule Get(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Gets a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The user rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static BaseUserRule CreateOrUpdate(this IUserRulesOperations operations, BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return operations.CreateOrUpdateAsync(userRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The user rule to create or update + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IUserRulesOperations operations, BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(userRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + public static void Delete(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IUserRulesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// 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 IUserRulesOperations 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/VirtualApplianceSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs index e7d7240f5434..f70daf085166 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs @@ -126,7 +126,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -743,7 +743,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs index ec79a1ee1f85..449fa5d2cb9d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs @@ -80,7 +80,7 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "skuName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs index e2b80f1d7aa4..9c339e4c9903 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +370,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { parameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -595,7 +595,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs index 4271ed1ff54e..a56174d4dcfa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs index bf751021572f..df80073e3142 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,11 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +789,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 index 0de362963f2c..354cd1ec42c8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -555,7 +555,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubRouteTableV2Parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -775,7 +775,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 e007237ac2dc..0caf9fd7fd62 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -943,7 +943,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { virtualHubParameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1159,7 +1159,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1336,7 +1336,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 5ce0797b1fac..1604eab56618 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -914,7 +914,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1130,7 +1130,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1313,7 +1313,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1529,7 +1529,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1763,7 +1763,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1969,7 +1969,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2174,7 +2174,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2371,7 +2371,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2557,7 +2557,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs deleted file mode 100644 index ee814ec18468..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs +++ /dev/null @@ -1,339 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights 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 VirtualNetworkGatewayNatRulesOperations. - /// - public static partial class VirtualNetworkGatewayNatRulesOperationsExtensions - { - /// - /// Retrieves the details of a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static VirtualNetworkGatewayNatRule Get(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) - { - return operations.GetAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the details of a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - public static VirtualNetworkGatewayNatRule CreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static void Delete(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) - { - operations.DeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the virtual network gateway. - /// - /// - /// The name of the gateway. - /// - public static IPage ListByVirtualNetworkGateway(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.ListByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the virtual network gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVirtualNetworkGatewayAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVirtualNetworkGatewayWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - public static VirtualNetworkGatewayNatRule BeginCreateOrUpdate(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - public static void BeginDelete(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName) - { - operations.BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a nat rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVirtualNetworkGatewayNext(this IVirtualNetworkGatewayNatRulesOperations operations, string nextPageLink) - { - return operations.ListByVirtualNetworkGatewayNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVirtualNetworkGatewayNextAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} 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 f47cb2856962..40fb68495c63 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1512,7 +1512,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1728,7 +1728,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1911,7 +1911,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2117,7 +2117,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2314,7 +2314,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2499,7 +2499,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2709,7 +2709,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2912,7 +2912,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3109,7 +3109,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3309,7 +3309,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3511,7 +3511,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3724,7 +3724,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3927,7 +3927,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4126,7 +4126,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4331,7 +4331,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4528,7 +4528,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4727,7 +4727,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 0657a5726962..0ccd8566d238 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -294,21 +294,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -356,7 +351,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -554,7 +549,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -704,11 +699,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// /// /// Headers that will be added to request. /// @@ -730,7 +720,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -756,7 +746,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -768,7 +758,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); - tracingParameters.Add("syncRemoteAddressSpace", syncRemoteAddressSpace); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -781,10 +770,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (syncRemoteAddressSpace != null) - { - _queryParameters.Add(string.Format("syncRemoteAddressSpace={0}", System.Uri.EscapeDataString(syncRemoteAddressSpace))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index f6a980126589..d4c7431621d0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -129,14 +129,9 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// - public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string)) + public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).GetAwaiter().GetResult(); } /// @@ -158,17 +153,12 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -276,14 +266,9 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// - public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string)) + public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).GetAwaiter().GetResult(); } /// @@ -305,17 +290,12 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// Parameters supplied to the create or update virtual network peering /// operation. /// - /// - /// Parameter indicates the intention to sync the peering with the current - /// address space on the remote vNet after it's updated. Possible values - /// include: 'true' - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } 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 597fbe0ff08c..44def54e4fbe 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,11 +1080,15 @@ internal VirtualNetworkTapsOperations(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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 5c62b84b0096..8198937acc58 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +919,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1118,7 +1118,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1309,7 +1309,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1496,7 +1496,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 54e6b69979aa..e0b0cb92bc27 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -731,7 +731,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 8c83fc5c0eef..091c4bd58907 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +686,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,7 +868,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperations.cs similarity index 99% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperations.cs index bf2e24e694f4..477f05588dbd 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1129,7 +1129,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperationsExtensions.cs 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 66d5205ffd41..aa8debf87029 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -409,7 +409,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -618,7 +618,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -843,7 +843,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1032,7 +1032,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1246,7 +1246,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 c3c39af40b43..aac3bd284911 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -428,7 +428,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -606,7 +606,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -808,7 +808,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { vpnGatewayParameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1034,7 +1034,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1232,7 +1232,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1408,7 +1408,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1606,7 +1606,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1811,7 +1811,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 f64eadd2408b..c10942629591 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs @@ -159,7 +159,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -366,7 +366,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 667e9949f2b1..c4afc6646191 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 = "2021-02-01"; + string apiVersion = "2020-11-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 20bb3c551cb5..d99abe8ef4e3 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1129,7 +1129,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 cd6fcd2a6fc1..8fb5dcdd2956 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 = "2021-02-01"; + string apiVersion = "2020-11-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 5406d91b1a3c..29b6f886a6b3 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 ea299f7b5105..7123e2f456ea 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 = "2021-02-01"; + string apiVersion = "2020-11-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 9f606dfb62d2..a2e680760bc0 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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -917,7 +917,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { vpnSiteParameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1133,7 +1133,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 9c640e0fff45..83783fcc8dfd 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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -675,7 +675,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { parameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-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 = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs index 9729187dde5b..f9692b3b3a8a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs @@ -90,7 +90,7 @@ internal WebCategoriesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -273,7 +273,7 @@ internal WebCategoriesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null;