diff --git a/eng/mgmt/mgmtmetadata/network_resource-manager.txt b/eng/mgmt/mgmtmetadata/network_resource-manager.txt index e0e5be824d4f..587c898d2afc 100644 --- a/eng/mgmt/mgmtmetadata/network_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/network_resource-manager.txt @@ -3,13 +3,13 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/network/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --use:@microsoft.azure/autorest.csharp@2.3.90 --csharp.output-folder=C:\Projects\generator\azure-sdk-for-net\sdk\network\Microsoft.Azure.Management.Network\src\Generated +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/netapp/resource-manager/readme.md --csharp --version=2.0.4421 --reflect-api-versions --use:@microsoft.azure/autorest.csharp@2.3.90 --csharp-sdks-folder=D:\GitRepos\AzureSdkForNet1\sdk +2022-07-12 21:02:36 UTC Autorest CSharp Version: 2.3.90 -2022-04-21 16:50:00 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: main Commit: df898cb9c4fb7ad0ee03a9e4d0e25607f130018d AutoRest information -Requested version: v2 +Requested version: 2.0.4421 Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props b/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props index 569fd58ac19e..b8f5a607612f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props +++ b/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props @@ -1,7 +1,7 @@ - Compute_2018-10-01;Network_2021-08-01; + Compute_2018-10-01;Network_2022-01-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file 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..0306b6bf62b0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs @@ -0,0 +1,1167 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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(AdminRuleCollection 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 (ruleCollection != null) + { + ruleCollection.Validate(); + } + 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 = "2022-01-01"; + // 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("force", force); + 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, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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 (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// 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..d449afe8079e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs @@ -0,0 +1,363 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 AdminRuleCollection 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 AdminRuleCollection CreateOrUpdate(this IAdminRuleCollectionsOperations operations, AdminRuleCollection 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, AdminRuleCollection 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRuleCollectionsDeleteHeaders Delete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?)) + { + return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRuleCollectionsDeleteHeaders BeginDelete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?)) + { + return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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..c7ae869b0030 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs @@ -0,0 +1,1200 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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 = "2022-01-01"; + // 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("force", force); + 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, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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 (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// 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..155e2473cca7 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs @@ -0,0 +1,389 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRulesDeleteHeaders Delete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?)) + { + return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static AdminRulesDeleteHeaders BeginDelete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?)) + { + return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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 257ec18fc459..2307e8999728 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +742,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 50172223ce64..95cd2946316f 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-08-01"; + string apiVersion = "2022-01-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 5402b90a9a08..c5263cf36b67 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 3c85c505a72e..39717412ee9a 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 10a33bedb83b..ffd45226b2f2 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-08-01"; + string apiVersion = "2022-01-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 40bd55b3c5f5..b3578f03fcba 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-08-01"; + string apiVersion = "2022-01-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 4a9e384e6226..83aafc30dc6c 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 8b8632dcd736..13221c0aa962 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-08-01"; + string apiVersion = "2022-01-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 b8234a1dbae8..b2a68b98d757 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 eb6d7416454b..f37975f6cd3a 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-08-01"; + string apiVersion = "2022-01-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 f6760f91b180..1dcde042e72b 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -677,6 +677,29 @@ internal AzureFirewallsOperations(NetworkManagementClient client) return _result; } + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Deletes the specified Azure Firewall. /// @@ -718,7 +741,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -912,7 +935,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1138,7 +1161,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1295,6 +1318,201 @@ internal AzureFirewallsOperations(NetworkManagementClient client) return _result; } + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> BeginListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (azureFirewallName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "azureFirewallName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("azureFirewallName", azureFirewallName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListLearnedPrefixes", 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/azureFirewalls/{azureFirewallName}/learnedIPPrefixes").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{azureFirewallName}", System.Uri.EscapeDataString(azureFirewallName)); + _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; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Lists all Azure Firewalls in a resource group. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs index 6306c3ca7b04..faef77de80b4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperationsExtensions.cs @@ -252,6 +252,48 @@ public static IPage ListAll(this IAzureFirewallsOperations operat } } + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + public static IPPrefixesList ListLearnedPrefixes(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + return operations.ListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// The cancellation token. + /// + public static async Task ListLearnedPrefixesAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Deletes the specified Azure Firewall. /// @@ -381,6 +423,48 @@ public static AzureFirewall BeginUpdateTags(this IAzureFirewallsOperations opera } } + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + public static IPPrefixesList BeginListLearnedPrefixes(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName) + { + return operations.BeginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a list of all IP prefixes that azure firewall has learned to not + /// SNAT. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// The cancellation token. + /// + public static async Task BeginListLearnedPrefixesAsync(this IAzureFirewallsOperations operations, string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListLearnedPrefixesWithHttpMessagesAsync(resourceGroupName, azureFirewallName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all Azure Firewalls in a resource group. /// 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 d65f1f017507..7b1170a32a4c 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -718,7 +718,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -905,7 +905,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1131,7 +1131,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 8973613894d9..59173c04669b 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConfigurationPolicyGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConfigurationPolicyGroupsOperations.cs index 613feb82ee4e..f2e94ef28171 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConfigurationPolicyGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConfigurationPolicyGroupsOperations.cs @@ -156,7 +156,7 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationPolicyGroupName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -563,7 +563,7 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationPolicyGroupParameters"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -788,7 +788,7 @@ internal ConfigurationPolicyGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationPolicyGroupName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 ffa36dc3dd79..dd5220e38350 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..bfdaffa90523 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs @@ -0,0 +1,1132 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ConnectivityConfigurationsOperations operations. + /// + internal partial class ConnectivityConfigurationsOperations : IServiceOperations, IConnectivityConfigurationsOperations + { + /// + /// Initializes a new instance of the ConnectivityConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ConnectivityConfigurationsOperations(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 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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}/connectivityConfigurations/{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/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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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(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"); + } + 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + 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, "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}/connectivityConfigurations/{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(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) + { + 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 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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}/connectivityConfigurations").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; + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("force", force); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + List _queryParameters = new List(); + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Lists all the network manager connectivity configuration in a specified + /// network manager. + /// + /// + /// 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/ConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..6dcbc9818272 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs @@ -0,0 +1,341 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static ConnectivityConfigurationsDeleteHeaders Delete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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; + } + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static ConnectivityConfigurationsDeleteHeaders BeginDelete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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 49fd212849df..08e1bcc9f23f 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 6eda403088d2..0233360fa1fe 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 cdfa8d199b36..eecc6d297e74 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 979dd9a9b2ff..1ecb6c69d1b7 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 2feaf061c9b0..3574eefa44a3 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index 85d61462d144..5afc73a3235e 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 d484ea7e94fa..89f995d5906d 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 b06a7274610b..0c6eb7dadb47 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 a212df783f66..c064bab0046b 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 605baeef6de2..047c6dae461c 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 a37c755e0542..3f031a70d861 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 d8d5cd141de7..902bb8370259 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 c4aba90ccc66..ffdce072f706 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 ab5c0a2f263b..38ca08457750 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortAuthorizationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortAuthorizationsOperations.cs index 325a4dd66fc5..94007ff6dcb6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortAuthorizationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortAuthorizationsOperations.cs @@ -126,7 +126,7 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +742,7 @@ internal ExpressRoutePortAuthorizationsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 7b089a38b6df..c6a5cc832f25 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 e8cccf86efff..28db9c392afa 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -916,7 +916,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteProviderPortsLocationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteProviderPortsLocationOperations.cs new file mode 100644 index 000000000000..e38535f15f5c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteProviderPortsLocationOperations.cs @@ -0,0 +1,239 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ExpressRouteProviderPortsLocationOperations operations. + /// + internal partial class ExpressRouteProviderPortsLocationOperations : IServiceOperations, IExpressRouteProviderPortsLocationOperations + { + /// + /// Initializes a new instance of the ExpressRouteProviderPortsLocationOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteProviderPortsLocationOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// + /// + /// The filter to apply on the operation. For example, you can use + /// $filter=location eq '{state}'. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts").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 (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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/ExpressRouteProviderPortsLocationOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteProviderPortsLocationOperationsExtensions.cs new file mode 100644 index 000000000000..04b9406a45ea --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteProviderPortsLocationOperationsExtensions.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 ExpressRouteProviderPortsLocationOperations. + /// + public static partial class ExpressRouteProviderPortsLocationOperationsExtensions + { + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter to apply on the operation. For example, you can use + /// $filter=location eq '{state}'. + /// + public static ExpressRouteProviderPortListResult List(this IExpressRouteProviderPortsLocationOperations operations, string filter = default(string)) + { + return operations.ListAsync(filter).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter to apply on the operation. For example, you can use + /// $filter=location eq '{state}'. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IExpressRouteProviderPortsLocationOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 fbe0370ccc0c..1d8823aa1742 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-08-01"; + string apiVersion = "2022-01-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 1f60bdaf34c8..c1a81c95e05b 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs index 7eef7edf1eee..8a04320fb9da 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesFilterValuesOperations.cs @@ -100,7 +100,7 @@ internal FirewallPolicyIdpsSignaturesFilterValuesOperations(NetworkManagementCli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOperations.cs index ed23285fe806..ef7dfe48275a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOperations.cs @@ -104,7 +104,7 @@ internal FirewallPolicyIdpsSignaturesOperations(NetworkManagementClient client) { parameters.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs index 353580531433..343dd948eab6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyIdpsSignaturesOverridesOperations.cs @@ -101,7 +101,7 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -309,7 +309,7 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -510,7 +510,7 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -705,7 +705,7 @@ internal FirewallPolicyIdpsSignaturesOverridesOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 6a1d7731272b..5d68bb50ae4b 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 cdf5266c9bd8..50cb51570c5d 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 0969a4c7d40b..df15bd362ee8 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 1e215fe32568..79e80c08fc1c 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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..9a455de91055 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs @@ -0,0 +1,227 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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(AdminRuleCollection 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// 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, bool? force = default(bool?), 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, bool? force = default(bool?), 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..74285d019678 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.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 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// 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, bool? force = default(bool?), 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, bool? force = default(bool?), 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/IAzureFirewallsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs index cc9533d0406e..097aaff28b66 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAzureFirewallsOperations.cs @@ -169,6 +169,32 @@ public partial interface IAzureFirewallsOperations /// Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Retrieves a list of all IP prefixes that azure firewall has learned + /// to not SNAT. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// 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> ListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Deletes the specified Azure Firewall. /// /// @@ -248,6 +274,32 @@ public partial interface IAzureFirewallsOperations /// Task> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Retrieves a list of all IP prefixes that azure firewall has learned + /// to not SNAT. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the azure firewall. + /// + /// + /// 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> BeginListLearnedPrefixesWithHttpMessagesAsync(string resourceGroupName, string azureFirewallName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all Azure Firewalls in a resource group. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..017452b5654c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs @@ -0,0 +1,214 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// 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, bool? force = default(bool?), 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)); + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), 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/IExpressRouteProviderPortsLocationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteProviderPortsLocationOperations.cs new file mode 100644 index 000000000000..b6d575312a0f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IExpressRouteProviderPortsLocationOperations.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; + + /// + /// ExpressRouteProviderPortsLocationOperations operations. + /// + public partial interface IExpressRouteProviderPortsLocationOperations + { + /// + /// Retrieves all the ExpressRouteProviderPorts in a subscription. + /// + /// + /// The filter to apply on the operation. For example, you can use + /// $filter=location eq '{state}'. + /// + /// + /// 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 filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs new file mode 100644 index 000000000000..47f90fdc8292 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IManagementGroupNetworkManagerConnectionsOperations.cs @@ -0,0 +1,163 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ManagementGroupNetworkManagerConnectionsOperations operations. + /// + public partial interface IManagementGroupNetworkManagerConnectionsOperations + { + /// + /// Create a network manager connection on this management group. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a specified connection created by this management group. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete specified pending connection created by this management + /// group. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network manager connections created by this management + /// group. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management 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 managementGroupId, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network manager connections created by this management + /// 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/INetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs new file mode 100644 index 000000000000..d8ac5f6a7d4d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs @@ -0,0 +1,211 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// 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, bool? force = default(bool?), 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)); + /// + /// Deletes a network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), 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 c8f9630d4d9c..99ac5527bde5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs @@ -320,6 +320,66 @@ 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 ISubscriptionNetworkManagerConnectionsOperations. + /// + ISubscriptionNetworkManagerConnectionsOperations SubscriptionNetworkManagerConnections { get; } + + /// + /// Gets the IManagementGroupNetworkManagerConnectionsOperations. + /// + IManagementGroupNetworkManagerConnectionsOperations ManagementGroupNetworkManagerConnections { get; } + + /// + /// Gets the IConnectivityConfigurationsOperations. + /// + IConnectivityConfigurationsOperations ConnectivityConfigurations { get; } + + /// + /// Gets the INetworkGroupsOperations. + /// + INetworkGroupsOperations NetworkGroups { get; } + + /// + /// Gets the IStaticMembersOperations. + /// + IStaticMembersOperations StaticMembers { get; } + + /// + /// Gets the IScopeConnectionsOperations. + /// + IScopeConnectionsOperations ScopeConnections { get; } + + /// + /// Gets the ISecurityAdminConfigurationsOperations. + /// + ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; } + + /// + /// Gets the IAdminRuleCollectionsOperations. + /// + IAdminRuleCollectionsOperations AdminRuleCollections { get; } + + /// + /// Gets the IAdminRulesOperations. + /// + IAdminRulesOperations AdminRules { get; } + /// /// Gets the INetworkProfilesOperations. /// @@ -645,6 +705,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IWebApplicationFirewallPoliciesOperations WebApplicationFirewallPolicies { get; } + /// + /// Gets the IExpressRouteProviderPortsLocationOperations. + /// + IExpressRouteProviderPortsLocationOperations ExpressRouteProviderPortsLocation { get; } + /// /// Creates a Bastion Shareable Links for all the VMs specified in the /// request. @@ -764,6 +829,88 @@ public partial interface INetworkManagementClient : System.IDisposable /// Task> CheckDnsNameAvailabilityWithHttpMessagesAsync(string location, string domainNameLabel, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ListActiveConnectivityConfigurationsWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ListActiveSecurityAdminRulesWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// List all effective security admin rules applied on a virtual + /// network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gives the supported security providers for the virtual wan. /// @@ -806,6 +953,20 @@ public partial interface INetworkManagementClient : System.IDisposable /// Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves detail of a provider port. + /// + /// + /// The name of the provider port. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ExpressRouteProviderPortMethodWithHttpMessagesAsync(string providerport, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates a Bastion Shareable Links for all the VMs specified in the /// request. 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..5832d09a5694 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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)); + /// + /// 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> BeginPostWithHttpMessagesAsync(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/INetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs new file mode 100644 index 000000000000..06a30dd82ec3 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs @@ -0,0 +1,269 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// 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, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Patch NetworkManager. + /// + /// + /// 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> PatchWithHttpMessagesAsync(PatchObject 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)); + /// + /// Deletes a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), 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/IScopeConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IScopeConnectionsOperations.cs new file mode 100644 index 000000000000..5d47ba005e8c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IScopeConnectionsOperations.cs @@ -0,0 +1,169 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ScopeConnectionsOperations operations. + /// + public partial interface IScopeConnectionsOperations + { + /// + /// Creates or updates scope connection from Network Manager + /// + /// + /// Scope connection to be created/updated. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get specified scope connection created by this Network Manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the pending scope connection created by this network + /// manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all scope connections created by this 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)); + /// + /// List all scope connections created by this 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/ISecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs new file mode 100644 index 000000000000..8f7e2a084558 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs @@ -0,0 +1,207 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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(SecurityAdminConfiguration 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// 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, bool? force = default(bool?), 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. + /// + /// + /// Deletes the resource even if it is part of a deployed + /// configuration. If the configuration has been deployed, the service + /// will do a cleanup deployment in the background, prior to the + /// delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), 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/IStaticMembersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IStaticMembersOperations.cs new file mode 100644 index 000000000000..97b088aab4a5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IStaticMembersOperations.cs @@ -0,0 +1,180 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// StaticMembersOperations operations. + /// + public partial interface IStaticMembersOperations + { + /// + /// Gets the specified static member. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// 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, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a static member. + /// + /// + /// Parameters supplied to the specify the static member to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// 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(StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a static member. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// 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, string staticMemberName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the specified static member. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network 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, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the specified static member. + /// + /// + /// 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/ISubscriptionNetworkManagerConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISubscriptionNetworkManagerConnectionsOperations.cs new file mode 100644 index 000000000000..54120aa5e9e1 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISubscriptionNetworkManagerConnectionsOperations.cs @@ -0,0 +1,144 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SubscriptionNetworkManagerConnectionsOperations operations. + /// + public partial interface ISubscriptionNetworkManagerConnectionsOperations + { + /// + /// Create a network manager connection on this subscription. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a specified connection created by this subscription. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete specified connection created by this subscription. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network manager connections created by this 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>> ListWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs index 9465ab1f502e..43652bcd80eb 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -748,7 +748,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 768590ac1302..f924a8e3fcb7 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-08-01"; + string apiVersion = "2022-01-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 66838c3df64c..bb2e652fae96 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 adf8b3235268..080ff74c8616 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 c9b9de5f5e8e..bc95f29d859a 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 c9147fc67468..0eb4e7620fa2 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 aa168366db9c..53aa273b6d77 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 f031ef4ae78c..17271ea6f98d 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-08-01"; + string apiVersion = "2022-01-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 2ba514e28efc..fbd507b4f2e1 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 1e015c4be39c..4c6011a3de0a 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 4de7a607143e..2f614811f67f 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -959,7 +959,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1142,7 +1142,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1358,7 +1358,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1553,7 +1553,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 3a4fa28e4cdd..b49c443daba7 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs new file mode 100644 index 000000000000..972614d13a4f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ManagementGroupNetworkManagerConnectionsOperations.cs @@ -0,0 +1,1017 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ManagementGroupNetworkManagerConnectionsOperations operations. + /// + internal partial class ManagementGroupNetworkManagerConnectionsOperations : IServiceOperations, IManagementGroupNetworkManagerConnectionsOperations + { + /// + /// Initializes a new instance of the ManagementGroupNetworkManagerConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagementGroupNetworkManagerConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Create a network manager connection on this management group. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (managementGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + } + if (networkManagerConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("managementGroupId", managementGroupId); + tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); + 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("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); + _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); + _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); + 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; + } + + /// + /// Get a specified connection created by this management group. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (managementGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + } + if (networkManagerConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("managementGroupId", managementGroupId); + tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); + 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("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); + _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); + _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); + 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; + } + + /// + /// Delete specified pending connection created by this management group. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string managementGroupId, string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (managementGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + } + if (networkManagerConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("managementGroupId", managementGroupId); + tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); + 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("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); + _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); + _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); + 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 connections created by this management group. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management 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 managementGroupId, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (managementGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("managementGroupId", managementGroupId); + 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("/") ? "" : "/")), "providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections").ToString(); + _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId)); + 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 manager connections created by this management 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/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..b1696c6b5d43 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ManagementGroupNetworkManagerConnectionsOperationsExtensions.cs @@ -0,0 +1,244 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 ManagementGroupNetworkManagerConnectionsOperations. + /// + public static partial class ManagementGroupNetworkManagerConnectionsOperationsExtensions + { + /// + /// Create a network manager connection on this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection CreateOrUpdate(this IManagementGroupNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName) + { + return operations.CreateOrUpdateAsync(parameters, managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Create a network manager connection on this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string managementGroupId, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a specified connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection Get(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName) + { + return operations.GetAsync(managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get a specified connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete specified pending connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + public static void Delete(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName) + { + operations.DeleteAsync(managementGroupId, networkManagerConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete specified pending connection created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management group. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(managementGroupId, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management 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 IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(managementGroupId, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The management group Id which uniquely identify the Microsoft Azure + /// management 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 IManagementGroupNetworkManagerConnectionsOperations operations, string managementGroupId, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(managementGroupId, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all network manager connections created by this management group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IManagementGroupNetworkManagerConnectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all network manager connections created by this management 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 IManagementGroupNetworkManagerConnectionsOperations 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/Models/ActiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs new file mode 100644 index 000000000000..d163f624c5bf --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs @@ -0,0 +1,106 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 description of the + /// security admin configuration. + /// 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 configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + CommitTime = commitTime; + Region = region; + ConfigurationDescription = configurationDescription; + 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 description of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { 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..1769e86f2518 --- /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..4c458ad3d9aa --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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' + /// Groups for configuration + /// Connectivity configuration ID. + /// A description of the connectivity + /// configuration. + /// List of hubItems + /// Flag if global mesh is supported. Possible + /// values include: 'False', 'True' + /// 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, IList appliesToGroups, string id = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList), System.DateTime? commitTime = default(System.DateTime?), string region = default(string)) + : base(connectivityTopology, appliesToGroups, id, description, hubs, isGlobal, 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..a6c9ddbd693b --- /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..0fc18ece1e4c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs @@ -0,0 +1,171 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 description of the + /// security admin configuration. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// 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 configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), 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, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + 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 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/ActiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs new file mode 100644 index 000000000000..c14c17ed9de7 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs @@ -0,0 +1,191 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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' + /// 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' + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A description of the + /// security admin configuration. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// 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 provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public ActiveSecurityAdminRule(string protocol, string access, int priority, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), 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, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + 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 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..343d36d55c0c --- /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/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..513154e1b699 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs @@ -0,0 +1,188 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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' + /// 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' + /// 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 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 provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public AdminRule(string protocol, string access, int priority, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), 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) + { + 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 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/AdminRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRuleCollection.cs new file mode 100644 index 000000000000..e89c766277de --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRuleCollection.cs @@ -0,0 +1,114 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 admin rule collection. + /// + [Rest.Serialization.JsonTransformation] + public partial class AdminRuleCollection : ChildResource + { + /// + /// Initializes a new instance of the AdminRuleCollection class. + /// + public AdminRuleCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminRuleCollection class. + /// + /// Groups for configuration + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A description of the admin rule + /// collection. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public AdminRuleCollection(IList appliesToGroups, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + 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 description of the admin 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; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AppliesToGroups == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppliesToGroups"); + } + if (AppliesToGroups != null) + { + foreach (var element in AppliesToGroups) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRuleCollectionsDeleteHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRuleCollectionsDeleteHeaders.cs new file mode 100644 index 000000000000..c0696140d27b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRuleCollectionsDeleteHeaders.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; + + /// + /// Defines headers for Delete operation. + /// + public partial class AdminRuleCollectionsDeleteHeaders + { + /// + /// Initializes a new instance of the AdminRuleCollectionsDeleteHeaders + /// class. + /// + public AdminRuleCollectionsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminRuleCollectionsDeleteHeaders + /// class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public AdminRuleCollectionsDeleteHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRulesDeleteHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRulesDeleteHeaders.cs new file mode 100644 index 000000000000..8116bcf4595a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRulesDeleteHeaders.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; + + /// + /// Defines headers for Delete operation. + /// + public partial class AdminRulesDeleteHeaders + { + /// + /// Initializes a new instance of the AdminRulesDeleteHeaders class. + /// + public AdminRulesDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminRulesDeleteHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public AdminRulesDeleteHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} 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 a55e0c729abd..e12d21830782 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 @@ -499,6 +499,16 @@ public virtual void Validate() } } } + if (RoutingRules != null) + { + foreach (var element3 in RoutingRules) + { + if (element3 != null) + { + element3.Validate(); + } + } + } if (WebApplicationFirewallConfiguration != null) { WebApplicationFirewallConfiguration.Validate(); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAvailableSslOptions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAvailableSslOptions.cs index 989b0586994d..0bc86c1cbd5d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAvailableSslOptions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAvailableSslOptions.cs @@ -46,7 +46,8 @@ public ApplicationGatewayAvailableSslOptions() /// Name of the Ssl predefined policy /// applied by default to application gateway. Possible values include: /// 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S' + /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', + /// 'AppGwSslPolicy20220101S' /// List of available Ssl cipher /// suites. /// List of available Ssl @@ -76,7 +77,8 @@ public ApplicationGatewayAvailableSslOptions() /// Gets or sets name of the Ssl predefined policy applied by default /// to application gateway. Possible values include: /// 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S' + /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', + /// 'AppGwSslPolicy20220101S' /// [JsonProperty(PropertyName = "properties.defaultPolicy")] public string DefaultPolicy { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRoutingRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRoutingRule.cs index c751c9875d1c..0ee6961dd24a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRoutingRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRoutingRule.cs @@ -34,6 +34,7 @@ public ApplicationGatewayRoutingRule() /// Initializes a new instance of the ApplicationGatewayRoutingRule /// class. /// + /// Priority of the routing rule. /// Resource ID. /// Rule type. Possible values include: 'Basic', /// 'PathBasedRouting' @@ -51,10 +52,11 @@ public ApplicationGatewayRoutingRule() /// A unique read-only string that changes whenever /// the resource is updated. /// Type of the resource. - public ApplicationGatewayRoutingRule(string id = default(string), string ruleType = default(string), SubResource backendAddressPool = default(SubResource), SubResource backendSettings = default(SubResource), SubResource listener = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public ApplicationGatewayRoutingRule(int priority, string id = default(string), string ruleType = default(string), SubResource backendAddressPool = default(SubResource), SubResource backendSettings = default(SubResource), SubResource listener = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { RuleType = ruleType; + Priority = priority; BackendAddressPool = backendAddressPool; BackendSettings = backendSettings; Listener = listener; @@ -77,6 +79,12 @@ public ApplicationGatewayRoutingRule() [JsonProperty(PropertyName = "properties.ruleType")] public string RuleType { get; set; } + /// + /// Gets or sets priority of the routing rule. + /// + [JsonProperty(PropertyName = "properties.priority")] + public int Priority { get; set; } + /// /// Gets or sets backend address pool resource of the application /// gateway. @@ -124,5 +132,22 @@ public ApplicationGatewayRoutingRule() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Priority > 20000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 20000); + } + if (Priority < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicy.cs index a2e2b4a37130..0147cb07632f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicy.cs @@ -36,15 +36,16 @@ public ApplicationGatewaySslPolicy() /// Ssl protocols to be disabled on /// application gateway. /// Type of Ssl Policy. Possible values - /// include: 'Predefined', 'Custom' + /// include: 'Predefined', 'Custom', 'CustomV2' /// Name of Ssl predefined policy. Possible /// values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S' + /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', + /// 'AppGwSslPolicy20220101S' /// Ssl cipher suites to be enabled in the /// specified order to application gateway. /// Minimum version of Ssl protocol to /// be supported on application gateway. Possible values include: - /// 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + /// 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' public ApplicationGatewaySslPolicy(IList disabledSslProtocols = default(IList), string policyType = default(string), string policyName = default(string), IList cipherSuites = default(IList), string minProtocolVersion = default(string)) { DisabledSslProtocols = disabledSslProtocols; @@ -68,7 +69,7 @@ public ApplicationGatewaySslPolicy() /// /// Gets or sets type of Ssl Policy. Possible values include: - /// 'Predefined', 'Custom' + /// 'Predefined', 'Custom', 'CustomV2' /// [JsonProperty(PropertyName = "policyType")] public string PolicyType { get; set; } @@ -76,7 +77,8 @@ public ApplicationGatewaySslPolicy() /// /// Gets or sets name of Ssl predefined policy. Possible values /// include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - /// 'AppGwSslPolicy20170401S' + /// 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', + /// 'AppGwSslPolicy20220101S' /// [JsonProperty(PropertyName = "policyName")] public string PolicyName { get; set; } @@ -91,7 +93,7 @@ public ApplicationGatewaySslPolicy() /// /// Gets or sets minimum version of Ssl protocol to be supported on /// application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', - /// 'TLSv1_2' + /// 'TLSv1_2', 'TLSv1_3' /// [JsonProperty(PropertyName = "minProtocolVersion")] public string MinProtocolVersion { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyName.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyName.cs index 81a5fdb5bb10..cba0b6d10d5c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyName.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyName.cs @@ -19,5 +19,7 @@ public static class ApplicationGatewaySslPolicyName public const string AppGwSslPolicy20150501 = "AppGwSslPolicy20150501"; public const string AppGwSslPolicy20170401 = "AppGwSslPolicy20170401"; public const string AppGwSslPolicy20170401S = "AppGwSslPolicy20170401S"; + public const string AppGwSslPolicy20220101 = "AppGwSslPolicy20220101"; + public const string AppGwSslPolicy20220101S = "AppGwSslPolicy20220101S"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyType.cs index 65d8491b627b..8bca23948a68 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPolicyType.cs @@ -18,5 +18,6 @@ public static class ApplicationGatewaySslPolicyType { public const string Predefined = "Predefined"; public const string Custom = "Custom"; + public const string CustomV2 = "CustomV2"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs index 8102427f8701..049f477b2048 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslPredefinedPolicy.cs @@ -42,7 +42,7 @@ public ApplicationGatewaySslPredefinedPolicy() /// specified order for application gateway. /// Minimum version of Ssl protocol to /// be supported on application gateway. Possible values include: - /// 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' + /// 'TLSv1_0', 'TLSv1_1', 'TLSv1_2', 'TLSv1_3' public ApplicationGatewaySslPredefinedPolicy(string id = default(string), string name = default(string), IList cipherSuites = default(IList), string minProtocolVersion = default(string)) : base(id) { @@ -73,7 +73,7 @@ public ApplicationGatewaySslPredefinedPolicy() /// /// Gets or sets minimum version of Ssl protocol to be supported on /// application gateway. Possible values include: 'TLSv1_0', 'TLSv1_1', - /// 'TLSv1_2' + /// 'TLSv1_2', 'TLSv1_3' /// [JsonProperty(PropertyName = "properties.minProtocolVersion")] public string MinProtocolVersion { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslProtocol.cs index d51a910cee35..5e4413db8fdc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslProtocol.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewaySslProtocol.cs @@ -19,5 +19,6 @@ public static class ApplicationGatewaySslProtocol public const string TLSv10 = "TLSv1_0"; public const string TLSv11 = "TLSv1_1"; public const string TLSv12 = "TLSv1_2"; + public const string TLSv13 = "TLSv1_3"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AutoLearnPrivateRangesMode.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AutoLearnPrivateRangesMode.cs new file mode 100644 index 000000000000..a90d3ee80f99 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AutoLearnPrivateRangesMode.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 AutoLearnPrivateRangesMode. + /// + public static class AutoLearnPrivateRangesMode + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} 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..0080e9eb7067 --- /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 : ChildResource + { + /// + /// 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/ChildResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ChildResource.cs new file mode 100644 index 000000000000..fffba08cc82b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ChildResource.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 ChildResource : IResource + { + /// + /// Initializes a new instance of the ChildResource class. + /// + public ChildResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ChildResource class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ChildResource(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/CommissionedState.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CommissionedState.cs index 18221cba3e9d..187ec0d7105c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CommissionedState.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CommissionedState.cs @@ -22,5 +22,6 @@ public static class CommissionedState public const string Commissioned = "Commissioned"; public const string Decommissioning = "Decommissioning"; public const string Deprovisioning = "Deprovisioning"; + public const string CommissionedNoInternetAdvertise = "CommissionedNoInternetAdvertise"; } } 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..5c19acbaf00c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// 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. + /// + /// Network group ID. + /// A description of the network + /// group. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + public ConfigurationGroup(string id = default(string), string description = default(string), string provisioningState = default(string)) + { + Id = id; + Description = description; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network group ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a description of the network group. + /// + [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; } + + } +} 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..47fd98bf8e93 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.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 ConfigurationType. + /// + public static class ConfigurationType + { + public const string SecurityAdmin = "SecurityAdmin"; + public const string Connectivity = "Connectivity"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorEndpoint.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorEndpoint.cs index 4fa629ec143b..90cc248d8cb0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorEndpoint.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorEndpoint.cs @@ -34,7 +34,8 @@ public ConnectionMonitorEndpoint() /// endpoint. /// The endpoint type. Possible values include: /// 'AzureVM', 'AzureVNet', 'AzureSubnet', 'ExternalAddress', - /// 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork' + /// 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', + /// 'AzureVMSS' /// Resource ID of the connection monitor /// endpoint. /// Address of the connection monitor endpoint @@ -71,7 +72,8 @@ public ConnectionMonitorEndpoint() /// /// Gets or sets the endpoint type. Possible values include: 'AzureVM', /// 'AzureVNet', 'AzureSubnet', 'ExternalAddress', - /// 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork' + /// 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', + /// 'AzureVMSS' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } 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..6ba259898531 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs @@ -0,0 +1,157 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 : ChildResource + { + /// + /// 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' + /// Groups for configuration + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A description of the connectivity + /// configuration. + /// List of hubItems + /// Flag if global mesh is supported. Possible + /// values include: 'False', 'True' + /// 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, IList appliesToGroups, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + Description = description; + ConnectivityTopology = connectivityTopology; + Hubs = hubs; + 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 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 list of hubItems + /// + [JsonProperty(PropertyName = "properties.hubs")] + public IList Hubs { 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"); + } + if (AppliesToGroups == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppliesToGroups"); + } + if (AppliesToGroups != null) + { + foreach (var element in AppliesToGroups) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfigurationsDeleteHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfigurationsDeleteHeaders.cs new file mode 100644 index 000000000000..707fdcd4dc48 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfigurationsDeleteHeaders.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; + + /// + /// Defines headers for Delete operation. + /// + public partial class ConnectivityConfigurationsDeleteHeaders + { + /// + /// Initializes a new instance of the + /// ConnectivityConfigurationsDeleteHeaders class. + /// + public ConnectivityConfigurationsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectivityConfigurationsDeleteHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public ConnectivityConfigurationsDeleteHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} 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..251ab6927ad4 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Connectivity group item. + /// + 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. + /// Group connectivity type. Possible + /// values include: 'None', 'DirectlyConnected' + /// Flag if need to use hub gateway. + /// Possible values include: 'False', 'True' + /// Flag if global is supported. Possible values + /// include: 'False', 'True' + public ConnectivityGroupItem(string networkGroupId, string groupConnectivity, string useHubGateway = default(string), string isGlobal = 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; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkGroupId"); + } + if (GroupConnectivity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "GroupConnectivity"); + } + } + } +} 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/CreatedByType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..f360566a259f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.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 CreatedByType. + /// + public static class CreatedByType + { + 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/CrossTenantScopes.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CrossTenantScopes.cs new file mode 100644 index 000000000000..df59ba9d22d8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CrossTenantScopes.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Cross tenant scopes. + /// + public partial class CrossTenantScopes + { + /// + /// Initializes a new instance of the CrossTenantScopes class. + /// + public CrossTenantScopes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CrossTenantScopes class. + /// + /// Tenant ID. + /// List of management groups. + /// List of subscriptions. + public CrossTenantScopes(string tenantId = default(string), IList managementGroups = default(IList), IList subscriptions = default(IList)) + { + TenantId = tenantId; + ManagementGroups = managementGroups; + Subscriptions = subscriptions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets tenant ID. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets list of management groups. + /// + [JsonProperty(PropertyName = "managementGroups")] + public IList ManagementGroups { get; private set; } + + /// + /// Gets list of subscriptions. + /// + [JsonProperty(PropertyName = "subscriptions")] + public IList Subscriptions { get; private set; } + + } +} 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 9d76ca3dd9f2..b92d7b5c166a 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 @@ -54,7 +54,9 @@ public CustomIpPrefix() /// The commissioned state of the /// Custom IP Prefix. Possible values include: 'Provisioning', /// 'Provisioned', 'Commissioning', 'Commissioned', 'Decommissioning', - /// 'Deprovisioning' + /// 'Deprovisioning', 'CommissionedNoInternetAdvertise' + /// Whether to Advertise the range to + /// Internet. /// The list of all referenced /// PublicIpPrefixes. /// The resource GUID property of the custom @@ -68,7 +70,7 @@ 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), SubResource customIpPrefixParent = default(SubResource), 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 signedMessage = default(string), string authorizationMessage = default(string), SubResource customIpPrefixParent = default(SubResource), IList childCustomIpPrefixes = default(IList), string commissionedState = default(string), bool? noInternetAdvertise = default(bool?), IList publicIpPrefixes = default(IList), string resourceGuid = default(string), string failedReason = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; @@ -78,6 +80,7 @@ public CustomIpPrefix() CustomIpPrefixParent = customIpPrefixParent; ChildCustomIpPrefixes = childCustomIpPrefixes; CommissionedState = commissionedState; + NoInternetAdvertise = noInternetAdvertise; PublicIpPrefixes = publicIpPrefixes; ResourceGuid = resourceGuid; FailedReason = failedReason; @@ -133,11 +136,17 @@ public CustomIpPrefix() /// Gets or sets the commissioned state of the Custom IP Prefix. /// Possible values include: 'Provisioning', 'Provisioned', /// 'Commissioning', 'Commissioned', 'Decommissioning', - /// 'Deprovisioning' + /// 'Deprovisioning', 'CommissionedNoInternetAdvertise' /// [JsonProperty(PropertyName = "properties.commissionedState")] public string CommissionedState { get; set; } + /// + /// Gets or sets whether to Advertise the range to Internet. + /// + [JsonProperty(PropertyName = "properties.noInternetAdvertise")] + public bool? NoInternetAdvertise { get; set; } + /// /// Gets the list of all referenced PublicIpPrefixes. /// 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..162c6068c4e3 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.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 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 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 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) + { + 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 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/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..ffe903e44dde --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 description of the + /// security admin configuration. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + public EffectiveBaseSecurityAdminRule(string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + ConfigurationDescription = configurationDescription; + 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 description of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { 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..89cc632850d8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs @@ -0,0 +1,161 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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' + /// Groups for configuration + /// Connectivity configuration ID. + /// A description of the connectivity + /// configuration. + /// List of hubItems + /// Flag if global mesh is supported. Possible + /// values include: 'False', 'True' + /// 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, IList appliesToGroups, string id = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList)) + { + Id = id; + Description = description; + ConnectivityTopology = connectivityTopology; + Hubs = hubs; + 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 connectivity configuration ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { 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 list of hubItems + /// + [JsonProperty(PropertyName = "properties.hubs")] + public IList Hubs { 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"); + } + if (AppliesToGroups == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AppliesToGroups"); + } + if (AppliesToGroups != null) + { + foreach (var element in AppliesToGroups) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} 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..b3d8f511e994 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs @@ -0,0 +1,169 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using 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 description of the + /// security admin configuration. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// 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 configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), 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, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + 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 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/EffectiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs new file mode 100644 index 000000000000..28034046bdd0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs @@ -0,0 +1,189 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.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' + /// 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' + /// Resource ID. + /// A description of the + /// security admin configuration. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// 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 provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public EffectiveSecurityAdminRule(string protocol, string access, int priority, string direction, string id = default(string), string configurationDescription = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), 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, configurationDescription, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + 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 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/EndpointType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EndpointType.cs index d7ccb5053316..afa465a9df97 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EndpointType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EndpointType.cs @@ -22,5 +22,7 @@ public static class EndpointType public const string ExternalAddress = "ExternalAddress"; public const string MMAWorkspaceMachine = "MMAWorkspaceMachine"; public const string MMAWorkspaceNetwork = "MMAWorkspaceNetwork"; + public const string AzureArcVM = "AzureArcVM"; + public const string AzureVMSS = "AzureVMSS"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxy.cs similarity index 82% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxy.cs index e764328c3b6a..520901741119 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxy.cs @@ -17,18 +17,18 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Explicit Proxy Settings in Firewall Policy. /// - public partial class ExplicitProxySettings + public partial class ExplicitProxy { /// - /// Initializes a new instance of the ExplicitProxySettings class. + /// Initializes a new instance of the ExplicitProxy class. /// - public ExplicitProxySettings() + public ExplicitProxy() { CustomInit(); } /// - /// Initializes a new instance of the ExplicitProxySettings class. + /// Initializes a new instance of the ExplicitProxy class. /// /// When set to true, explicit proxy /// mode is enabled. @@ -36,14 +36,17 @@ public ExplicitProxySettings() /// protocol, cannot be greater than 64000. /// Port number for explicit proxy https /// protocol, cannot be greater than 64000. + /// When set to true, pac file port and url + /// needs to be provided. /// Port number for firewall to serve PAC /// file. /// SAS URL for PAC file. - public ExplicitProxySettings(bool? enableExplicitProxy = default(bool?), int? httpPort = default(int?), int? httpsPort = default(int?), int? pacFilePort = default(int?), string pacFile = default(string)) + public ExplicitProxy(bool? enableExplicitProxy = default(bool?), int? httpPort = default(int?), int? httpsPort = default(int?), bool? enablePacFile = default(bool?), int? pacFilePort = default(int?), string pacFile = default(string)) { EnableExplicitProxy = enableExplicitProxy; HttpPort = httpPort; HttpsPort = httpsPort; + EnablePacFile = enablePacFile; PacFilePort = pacFilePort; PacFile = pacFile; CustomInit(); @@ -74,6 +77,13 @@ public ExplicitProxySettings() [JsonProperty(PropertyName = "httpsPort")] public int? HttpsPort { get; set; } + /// + /// Gets or sets when set to true, pac file port and url needs to be + /// provided. + /// + [JsonProperty(PropertyName = "enablePacFile")] + public bool? EnablePacFile { get; set; } + /// /// Gets or sets port number for firewall to serve PAC file. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteProviderPort.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteProviderPort.cs new file mode 100644 index 000000000000..e7008aafd3bb --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteProviderPort.cs @@ -0,0 +1,135 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ExpressRouteProviderPort resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteProviderPort : Resource + { + /// + /// Initializes a new instance of the ExpressRouteProviderPort class. + /// + public ExpressRouteProviderPort() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteProviderPort class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The name of the port pair. + /// The name of the primary + /// port. + /// The name of the secondary + /// port. + /// The peering location of the port + /// pair. + /// Overprovisioning factor for the + /// port pair. + /// Bandwidth of the port in + /// Mbps + /// Used Bandwidth of the port in + /// Mbps + /// Remaining Bandwidth of the + /// port in Mbps + /// A unique read-only string that changes whenever + /// the resource is updated. + public ExpressRouteProviderPort(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string portPairDescriptor = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string peeringLocation = default(string), int? overprovisionFactor = default(int?), int? portBandwidthInMbps = default(int?), int? usedBandwidthInMbps = default(int?), int? remainingBandwidthInMbps = default(int?), string etag = default(string)) + : base(id, name, type, location, tags) + { + PortPairDescriptor = portPairDescriptor; + PrimaryAzurePort = primaryAzurePort; + SecondaryAzurePort = secondaryAzurePort; + PeeringLocation = peeringLocation; + OverprovisionFactor = overprovisionFactor; + PortBandwidthInMbps = portBandwidthInMbps; + UsedBandwidthInMbps = usedBandwidthInMbps; + RemainingBandwidthInMbps = remainingBandwidthInMbps; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the port pair. + /// + [JsonProperty(PropertyName = "properties.portPairDescriptor")] + public string PortPairDescriptor { get; private set; } + + /// + /// Gets the name of the primary port. + /// + [JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort { get; private set; } + + /// + /// Gets the name of the secondary port. + /// + [JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort { get; private set; } + + /// + /// Gets or sets the peering location of the port pair. + /// + [JsonProperty(PropertyName = "properties.peeringLocation")] + public string PeeringLocation { get; set; } + + /// + /// Gets or sets overprovisioning factor for the port pair. + /// + [JsonProperty(PropertyName = "properties.overprovisionFactor")] + public int? OverprovisionFactor { get; set; } + + /// + /// Gets or sets bandwidth of the port in Mbps + /// + [JsonProperty(PropertyName = "properties.portBandwidthInMbps")] + public int? PortBandwidthInMbps { get; set; } + + /// + /// Gets or sets used Bandwidth of the port in Mbps + /// + [JsonProperty(PropertyName = "properties.usedBandwidthInMbps")] + public int? UsedBandwidthInMbps { get; set; } + + /// + /// Gets or sets remaining Bandwidth of the port in Mbps + /// + [JsonProperty(PropertyName = "properties.remainingBandwidthInMbps")] + public int? RemainingBandwidthInMbps { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteProviderPortListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteProviderPortListResult.cs new file mode 100644 index 000000000000..8ec00b2a8189 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteProviderPortListResult.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Response for ListExpressRouteProviderPort API service call. + /// + public partial class ExpressRouteProviderPortListResult + { + /// + /// Initializes a new instance of the + /// ExpressRouteProviderPortListResult class. + /// + public ExpressRouteProviderPortListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteProviderPortListResult class. + /// + /// A list of ExpressRouteProviderPort + /// resources. + /// The URL to get the next set of + /// results. + public ExpressRouteProviderPortListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of ExpressRouteProviderPort resources. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets the URL to get the next set of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs index ad8cd916585f..e54798f09b13 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs @@ -60,7 +60,7 @@ public FirewallPolicy() /// traffic will not be SNAT. /// SQL Settings definition. /// DNS Proxy Settings definition. - /// Explicit Proxy Settings + /// Explicit Proxy Settings /// definition. /// The configuration for Intrusion /// detection. @@ -70,7 +70,7 @@ public FirewallPolicy() /// A unique read-only string that changes whenever /// the resource is updated. /// The identity of the firewall policy. - public FirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList ruleCollectionGroups = default(IList), string provisioningState = default(string), SubResource basePolicy = default(SubResource), IList firewalls = default(IList), IList childPolicies = default(IList), string threatIntelMode = default(string), FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default(FirewallPolicyThreatIntelWhitelist), FirewallPolicyInsights insights = default(FirewallPolicyInsights), FirewallPolicySNAT snat = default(FirewallPolicySNAT), FirewallPolicySQL sql = default(FirewallPolicySQL), DnsSettings dnsSettings = default(DnsSettings), ExplicitProxySettings explicitProxySettings = default(ExplicitProxySettings), FirewallPolicyIntrusionDetection intrusionDetection = default(FirewallPolicyIntrusionDetection), FirewallPolicyTransportSecurity transportSecurity = default(FirewallPolicyTransportSecurity), FirewallPolicySku sku = default(FirewallPolicySku), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public FirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList ruleCollectionGroups = default(IList), string provisioningState = default(string), SubResource basePolicy = default(SubResource), IList firewalls = default(IList), IList childPolicies = default(IList), string threatIntelMode = default(string), FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default(FirewallPolicyThreatIntelWhitelist), FirewallPolicyInsights insights = default(FirewallPolicyInsights), FirewallPolicySNAT snat = default(FirewallPolicySNAT), FirewallPolicySQL sql = default(FirewallPolicySQL), DnsSettings dnsSettings = default(DnsSettings), ExplicitProxy explicitProxy = default(ExplicitProxy), FirewallPolicyIntrusionDetection intrusionDetection = default(FirewallPolicyIntrusionDetection), FirewallPolicyTransportSecurity transportSecurity = default(FirewallPolicyTransportSecurity), FirewallPolicySku sku = default(FirewallPolicySku), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(id, name, type, location, tags) { RuleCollectionGroups = ruleCollectionGroups; @@ -84,7 +84,7 @@ public FirewallPolicy() Snat = snat; Sql = sql; DnsSettings = dnsSettings; - ExplicitProxySettings = explicitProxySettings; + ExplicitProxy = explicitProxy; IntrusionDetection = intrusionDetection; TransportSecurity = transportSecurity; Sku = sku; @@ -173,8 +173,8 @@ public FirewallPolicy() /// /// Gets or sets explicit Proxy Settings definition. /// - [JsonProperty(PropertyName = "properties.explicitProxySettings")] - public ExplicitProxySettings ExplicitProxySettings { get; set; } + [JsonProperty(PropertyName = "properties.explicitProxy")] + public ExplicitProxy ExplicitProxy { get; set; } /// /// Gets or sets the configuration for Intrusion detection. @@ -215,9 +215,9 @@ public FirewallPolicy() /// public virtual void Validate() { - if (ExplicitProxySettings != null) + if (ExplicitProxy != null) { - ExplicitProxySettings.Validate(); + ExplicitProxy.Validate(); } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySNAT.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySNAT.cs index 9eb747e362e7..b3146d4796a8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySNAT.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySNAT.cs @@ -33,9 +33,13 @@ public FirewallPolicySNAT() /// /// List of private IP addresses/IP address /// ranges to not be SNAT. - public FirewallPolicySNAT(IList privateRanges = default(IList)) + /// The operation mode for + /// automatically learning private ranges to not be SNAT. Possible + /// values include: 'Enabled', 'Disabled' + public FirewallPolicySNAT(IList privateRanges = default(IList), string autoLearnPrivateRanges = default(string)) { PrivateRanges = privateRanges; + AutoLearnPrivateRanges = autoLearnPrivateRanges; CustomInit(); } @@ -51,5 +55,13 @@ public FirewallPolicySNAT() [JsonProperty(PropertyName = "privateRanges")] public IList PrivateRanges { get; set; } + /// + /// Gets or sets the operation mode for automatically learning private + /// ranges to not be SNAT. Possible values include: 'Enabled', + /// 'Disabled' + /// + [JsonProperty(PropertyName = "autoLearnPrivateRanges")] + public string AutoLearnPrivateRanges { get; set; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs new file mode 100644 index 000000000000..1887920ed507 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.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 GroupConnectivity. + /// + public static class GroupConnectivity + { + public const string None = "None"; + public const string DirectlyConnected = "DirectlyConnected"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs new file mode 100644 index 000000000000..a086b9d5dd9a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.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; + + /// + /// Hub Item. + /// + public partial class Hub + { + /// + /// Initializes a new instance of the Hub class. + /// + public Hub() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Hub class. + /// + /// Resource Id. + /// Resource Type. + public Hub(string resourceId = default(string), string resourceType = default(string)) + { + ResourceId = resourceId; + ResourceType = resourceType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource Id. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets resource Type. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPPrefixesList.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPPrefixesList.cs new file mode 100644 index 000000000000..c139f41975f5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPPrefixesList.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// List of SNAT IP Prefixes learnt by firewall to not SNAT + /// + public partial class IPPrefixesList + { + /// + /// Initializes a new instance of the IPPrefixesList class. + /// + public IPPrefixesList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IPPrefixesList class. + /// + /// IP Prefix value. + public IPPrefixesList(IList ipPrefixes = default(IList)) + { + IpPrefixes = ipPrefixes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets IP Prefix value. + /// + [JsonProperty(PropertyName = "ipPrefixes")] + public IList IpPrefixes { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs new file mode 100644 index 000000000000..11c8db830ff0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.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 IsGlobal. + /// + public static class IsGlobal + { + public const string False = "False"; + public const string True = "True"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs index fddaf2c3c02b..9fbd7d10886e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MatchCondition.cs @@ -36,7 +36,7 @@ public MatchCondition() /// The operator to be matched. Possible /// values include: 'IPMatch', 'Equal', 'Contains', 'LessThan', /// 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', - /// 'BeginsWith', 'EndsWith', 'Regex', 'GeoMatch' + /// 'BeginsWith', 'EndsWith', 'Regex', 'GeoMatch', 'Any' /// Match value. /// Whether this is negate condition or /// not. @@ -66,7 +66,7 @@ public MatchCondition() /// Gets or sets the operator to be matched. Possible values include: /// 'IPMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', /// 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', - /// 'Regex', 'GeoMatch' + /// 'Regex', 'GeoMatch', 'Any' /// [JsonProperty(PropertyName = "operator")] public string OperatorProperty { get; set; } 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..70d7bd4bcc91 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// The network group resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkGroup : ChildResource + { + /// + /// 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 description of the network + /// group. + /// 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 description = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + Description = description; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a description of the network group. + /// + [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 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/NetworkGroupsCreateOrUpdateHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..dde367cf19ed --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.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; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class NetworkGroupsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// NetworkGroupsCreateOrUpdateHeaders class. + /// + public NetworkGroupsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkGroupsCreateOrUpdateHeaders class. + /// + /// The current entity tag. + public NetworkGroupsCreateOrUpdateHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the current entity tag. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsDeleteHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsDeleteHeaders.cs new file mode 100644 index 000000000000..56e717ef772f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsDeleteHeaders.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; + + /// + /// Defines headers for Delete operation. + /// + public partial class NetworkGroupsDeleteHeaders + { + /// + /// Initializes a new instance of the NetworkGroupsDeleteHeaders class. + /// + public NetworkGroupsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkGroupsDeleteHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public NetworkGroupsDeleteHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicyBasedService.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicyBasedService.cs new file mode 100644 index 000000000000..97b0dc7ece41 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkIntentPolicyBasedService.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 NetworkIntentPolicyBasedService. + /// + public static class NetworkIntentPolicyBasedService + { + public const string None = "None"; + public const string All = "All"; + } +} 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 7c1a1c6def2a..4d2351edfd89 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 @@ -60,7 +60,8 @@ public NetworkInterface() /// Whether the virtual machine /// this nic is attached to supports encryption. /// If the network interface - /// is accelerated networking enabled. + /// is configured for accelerated networking. Not applicable to VM + /// sizes which require accelerated networking. /// Indicates whether IP forwarding is /// enabled on this network interface. /// A list of references to linked @@ -183,8 +184,9 @@ public NetworkInterface() public bool? VnetEncryptionSupported { get; private set; } /// - /// Gets or sets if the network interface is accelerated networking - /// enabled. + /// Gets or sets if the network interface is configured for accelerated + /// networking. Not applicable to VM sizes which require accelerated + /// networking. /// [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] public bool? EnableAcceleratedNetworking { get; set; } 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..aa6b731e3441 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs @@ -0,0 +1,128 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// Scope of Network + /// Manager. + /// Scope Access. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A description of the network + /// manager. + /// The provisioning state of the + /// network manager 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(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes, IList networkManagerScopeAccesses, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string description = default(string), string provisioningState = default(string), string etag = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location, tags) + { + 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 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 network manager 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; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkManagerScopes == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkManagerScopes"); + } + if (NetworkManagerScopeAccesses == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkManagerScopeAccesses"); + } + } + } +} 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..ec16e6e13647 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// 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. + /// + /// List of target locations. + /// Commit Type. Possible values include: + /// 'SecurityAdmin', 'Connectivity' + /// Commit Id. + /// List of configuration ids. + public NetworkManagerCommit(IList targetLocations, string commitType, string commitId = default(string), IList configurationIds = default(IList)) + { + 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', + /// 'Connectivity' + /// + [JsonProperty(PropertyName = "commitType")] + public string CommitType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetLocations == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetLocations"); + } + if (CommitType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CommitType"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommitsPostHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommitsPostHeaders.cs new file mode 100644 index 000000000000..26f7c224c836 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommitsPostHeaders.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; + + /// + /// Defines headers for Post operation. + /// + public partial class NetworkManagerCommitsPostHeaders + { + /// + /// Initializes a new instance of the NetworkManagerCommitsPostHeaders + /// class. + /// + public NetworkManagerCommitsPostHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerCommitsPostHeaders + /// class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public NetworkManagerCommitsPostHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerConnection.cs new file mode 100644 index 000000000000..c2b251c44fe4 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerConnection.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// The Network Manager Connection resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkManagerConnection : ChildResource + { + /// + /// Initializes a new instance of the NetworkManagerConnection class. + /// + public NetworkManagerConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerConnection class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// Network Manager Id. + /// Connection state. Possible values + /// include: 'Connected', 'Pending', 'Conflict', 'Revoked', + /// 'Rejected' + /// A description of the network manager + /// connection. + /// The system metadata related to this + /// resource. + public NetworkManagerConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string networkManagerId = default(string), string connectionState = default(string), string description = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + NetworkManagerId = networkManagerId; + ConnectionState = connectionState; + Description = description; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network Manager Id. + /// + [JsonProperty(PropertyName = "properties.networkManagerId")] + public string NetworkManagerId { get; set; } + + /// + /// Gets or sets connection state. Possible values include: + /// 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' + /// + [JsonProperty(PropertyName = "properties.connectionState")] + public string ConnectionState { get; set; } + + /// + /// Gets or sets a description of the network manager connection. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; 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/NetworkManagerDeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs new file mode 100644 index 000000000000..4ad48dbcba50 --- /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', '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', + /// '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..383a5dda10df --- /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..5f72882b1163 --- /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..3450d169eb10 --- /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..aa26d6280c37 --- /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..e05dfbf54108 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// List of cross tenant + /// scopes. + public NetworkManagerPropertiesNetworkManagerScopes(IList managementGroups = default(IList), IList subscriptions = default(IList), IList crossTenantScopes = default(IList)) + { + ManagementGroups = managementGroups; + Subscriptions = subscriptions; + CrossTenantScopes = crossTenantScopes; + 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; } + + /// + /// Gets list of cross tenant scopes. + /// + [JsonProperty(PropertyName = "crossTenantScopes")] + public IList CrossTenantScopes { get; private 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..a60a0d23c14e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.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 Microsoft.Rest; + 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) + { + 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; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkGroupId"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagersDeleteHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagersDeleteHeaders.cs new file mode 100644 index 000000000000..a5f5f38d20a6 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagersDeleteHeaders.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; + + /// + /// Defines headers for Delete operation. + /// + public partial class NetworkManagersDeleteHeaders + { + /// + /// Initializes a new instance of the NetworkManagersDeleteHeaders + /// class. + /// + public NetworkManagersDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagersDeleteHeaders + /// class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public NetworkManagersDeleteHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs index e85d49ab4af8..3f13ed5ad2e1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityGroup.cs @@ -39,6 +39,9 @@ public NetworkSecurityGroup() /// Resource type. /// Resource location. /// Resource tags. + /// When enabled, flows created from + /// Network Security Group connections will be re-evaluated when rules + /// are updates. Initial enablement will trigger re-evaluation. /// A collection of security rules of the /// network security group. /// The default security rules of @@ -56,9 +59,10 @@ public NetworkSecurityGroup() /// 'Succeeded', 'Updating', 'Deleting', 'Failed' /// A unique read-only string that changes whenever /// the resource is updated. - public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList securityRules = default(IList), IList defaultSecurityRules = default(IList), IList networkInterfaces = default(IList), IList subnets = default(IList), IList flowLogs = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? flushConnection = default(bool?), IList securityRules = default(IList), IList defaultSecurityRules = default(IList), IList networkInterfaces = default(IList), IList subnets = default(IList), IList flowLogs = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { + FlushConnection = flushConnection; SecurityRules = securityRules; DefaultSecurityRules = defaultSecurityRules; NetworkInterfaces = networkInterfaces; @@ -75,6 +79,14 @@ public NetworkSecurityGroup() /// partial void CustomInit(); + /// + /// Gets or sets when enabled, flows created from Network Security + /// Group connections will be re-evaluated when rules are updates. + /// Initial enablement will trigger re-evaluation. + /// + [JsonProperty(PropertyName = "properties.flushConnection")] + public bool? FlushConnection { get; set; } + /// /// Gets or sets a collection of security rules of the network security /// group. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs index 270be9f057ac..d5eb6c05a7e4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs @@ -34,10 +34,16 @@ public PacketCapture() /// /// Initializes a new instance of the PacketCapture class. /// - /// The ID of the targeted resource, only VM is - /// currently supported. + /// The ID of the targeted resource, only AzureVM + /// and AzureVMSS as target type are currently supported. /// The storage location for a packet /// capture session. + /// A list of AzureVMSS instances which can be + /// included or excluded to run packet capture. If both included and + /// excluded are empty, then the packet capture will run on all + /// instances of AzureVMSS. + /// Target type of the resource provided. + /// Possible values include: 'AzureVM', 'AzureVMSS' /// Number of bytes captured per /// packet, the remaining bytes are truncated. /// Maximum size of the capture @@ -45,9 +51,11 @@ public PacketCapture() /// Maximum duration of the capture /// session in seconds. /// A list of packet capture filters. - public PacketCapture(string target, PacketCaptureStorageLocation storageLocation, long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList)) + public PacketCapture(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList)) { Target = target; + Scope = scope; + TargetType = targetType; BytesToCapturePerPacket = bytesToCapturePerPacket; TotalBytesPerSession = totalBytesPerSession; TimeLimitInSeconds = timeLimitInSeconds; @@ -62,12 +70,28 @@ public PacketCapture() partial void CustomInit(); /// - /// Gets or sets the ID of the targeted resource, only VM is currently - /// supported. + /// Gets or sets the ID of the targeted resource, only AzureVM and + /// AzureVMSS as target type are currently supported. /// [JsonProperty(PropertyName = "properties.target")] public string Target { get; set; } + /// + /// Gets or sets a list of AzureVMSS instances which can be included or + /// excluded to run packet capture. If both included and excluded are + /// empty, then the packet capture will run on all instances of + /// AzureVMSS. + /// + [JsonProperty(PropertyName = "properties.scope")] + public PacketCaptureMachineScope Scope { get; set; } + + /// + /// Gets or sets target type of the resource provided. Possible values + /// include: 'AzureVM', 'AzureVMSS' + /// + [JsonProperty(PropertyName = "properties.targetType")] + public PacketCaptureTargetType? TargetType { get; set; } + /// /// Gets or sets number of bytes captured per packet, the remaining /// bytes are truncated. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureMachineScope.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureMachineScope.cs new file mode 100644 index 000000000000..e85a9f139610 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureMachineScope.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 AzureVMSS instances which can be included or excluded to run + /// packet capture. If both included and excluded are empty, then the + /// packet capture will run on all instances of AzureVMSS. + /// + public partial class PacketCaptureMachineScope + { + /// + /// Initializes a new instance of the PacketCaptureMachineScope class. + /// + public PacketCaptureMachineScope() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PacketCaptureMachineScope class. + /// + /// List of AzureVMSS instances to run packet + /// capture on. + /// List of AzureVMSS instances which has to be + /// excluded from the AzureVMSS from running packet capture. + public PacketCaptureMachineScope(IList include = default(IList), IList exclude = default(IList)) + { + Include = include; + Exclude = exclude; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of AzureVMSS instances to run packet capture on. + /// + [JsonProperty(PropertyName = "include")] + public IList Include { get; set; } + + /// + /// Gets or sets list of AzureVMSS instances which has to be excluded + /// from the AzureVMSS from running packet capture. + /// + [JsonProperty(PropertyName = "exclude")] + public IList Exclude { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs index a8a225ae7b4b..690a1c756148 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs @@ -32,10 +32,16 @@ public PacketCaptureParameters() /// /// Initializes a new instance of the PacketCaptureParameters class. /// - /// The ID of the targeted resource, only VM is - /// currently supported. + /// The ID of the targeted resource, only AzureVM + /// and AzureVMSS as target type are currently supported. /// The storage location for a packet /// capture session. + /// A list of AzureVMSS instances which can be + /// included or excluded to run packet capture. If both included and + /// excluded are empty, then the packet capture will run on all + /// instances of AzureVMSS. + /// Target type of the resource provided. + /// Possible values include: 'AzureVM', 'AzureVMSS' /// Number of bytes captured per /// packet, the remaining bytes are truncated. /// Maximum size of the capture @@ -43,9 +49,11 @@ public PacketCaptureParameters() /// Maximum duration of the capture /// session in seconds. /// A list of packet capture filters. - public PacketCaptureParameters(string target, PacketCaptureStorageLocation storageLocation, long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList)) + public PacketCaptureParameters(string target, PacketCaptureStorageLocation storageLocation, PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList)) { Target = target; + Scope = scope; + TargetType = targetType; BytesToCapturePerPacket = bytesToCapturePerPacket; TotalBytesPerSession = totalBytesPerSession; TimeLimitInSeconds = timeLimitInSeconds; @@ -60,12 +68,28 @@ public PacketCaptureParameters() partial void CustomInit(); /// - /// Gets or sets the ID of the targeted resource, only VM is currently - /// supported. + /// Gets or sets the ID of the targeted resource, only AzureVM and + /// AzureVMSS as target type are currently supported. /// [JsonProperty(PropertyName = "target")] public string Target { get; set; } + /// + /// Gets or sets a list of AzureVMSS instances which can be included or + /// excluded to run packet capture. If both included and excluded are + /// empty, then the packet capture will run on all instances of + /// AzureVMSS. + /// + [JsonProperty(PropertyName = "scope")] + public PacketCaptureMachineScope Scope { get; set; } + + /// + /// Gets or sets target type of the resource provided. Possible values + /// include: 'AzureVM', 'AzureVMSS' + /// + [JsonProperty(PropertyName = "targetType")] + public PacketCaptureTargetType? TargetType { get; set; } + /// /// Gets or sets number of bytes captured per packet, the remaining /// bytes are truncated. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs index cdd1a0f896be..8da87f88ce34 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs @@ -34,14 +34,20 @@ public PacketCaptureResult() /// /// Initializes a new instance of the PacketCaptureResult class. /// - /// The ID of the targeted resource, only VM is - /// currently supported. + /// The ID of the targeted resource, only AzureVM + /// and AzureVMSS as target type are currently supported. /// The storage location for a packet /// capture session. /// Name of the packet capture session. /// ID of the packet capture operation. /// A unique read-only string that changes whenever /// the resource is updated. + /// A list of AzureVMSS instances which can be + /// included or excluded to run packet capture. If both included and + /// excluded are empty, then the packet capture will run on all + /// instances of AzureVMSS. + /// Target type of the resource provided. + /// Possible values include: 'AzureVM', 'AzureVMSS' /// Number of bytes captured per /// packet, the remaining bytes are truncated. /// Maximum size of the capture @@ -52,12 +58,14 @@ public PacketCaptureResult() /// The provisioning state of the /// packet capture session. Possible values include: 'Succeeded', /// 'Updating', 'Deleting', 'Failed' - public PacketCaptureResult(string target, PacketCaptureStorageLocation storageLocation, string name = default(string), string id = default(string), string etag = default(string), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList), string provisioningState = default(string)) + public PacketCaptureResult(string target, PacketCaptureStorageLocation storageLocation, string name = default(string), string id = default(string), string etag = default(string), PacketCaptureMachineScope scope = default(PacketCaptureMachineScope), PacketCaptureTargetType? targetType = default(PacketCaptureTargetType?), long? bytesToCapturePerPacket = default(long?), long? totalBytesPerSession = default(long?), int? timeLimitInSeconds = default(int?), IList filters = default(IList), string provisioningState = default(string)) { Name = name; Id = id; Etag = etag; Target = target; + Scope = scope; + TargetType = targetType; BytesToCapturePerPacket = bytesToCapturePerPacket; TotalBytesPerSession = totalBytesPerSession; TimeLimitInSeconds = timeLimitInSeconds; @@ -92,12 +100,28 @@ public PacketCaptureResult() public string Etag { get; private set; } /// - /// Gets or sets the ID of the targeted resource, only VM is currently - /// supported. + /// Gets or sets the ID of the targeted resource, only AzureVM and + /// AzureVMSS as target type are currently supported. /// [JsonProperty(PropertyName = "properties.target")] public string Target { get; set; } + /// + /// Gets or sets a list of AzureVMSS instances which can be included or + /// excluded to run packet capture. If both included and excluded are + /// empty, then the packet capture will run on all instances of + /// AzureVMSS. + /// + [JsonProperty(PropertyName = "properties.scope")] + public PacketCaptureMachineScope Scope { get; set; } + + /// + /// Gets or sets target type of the resource provided. Possible values + /// include: 'AzureVM', 'AzureVMSS' + /// + [JsonProperty(PropertyName = "properties.targetType")] + public PacketCaptureTargetType? TargetType { get; set; } + /// /// Gets or sets number of bytes captured per packet, the remaining /// bytes are truncated. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureTargetType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureTargetType.cs new file mode 100644 index 000000000000..bf25862e14b0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureTargetType.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for PacketCaptureTargetType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PacketCaptureTargetType + { + [EnumMember(Value = "AzureVM")] + AzureVM, + [EnumMember(Value = "AzureVMSS")] + AzureVMSS + } + internal static class PacketCaptureTargetTypeEnumExtension + { + internal static string ToSerializedValue(this PacketCaptureTargetType? value) + { + return value == null ? null : ((PacketCaptureTargetType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this PacketCaptureTargetType value) + { + switch( value ) + { + case PacketCaptureTargetType.AzureVM: + return "AzureVM"; + case PacketCaptureTargetType.AzureVMSS: + return "AzureVMSS"; + } + return null; + } + + internal static PacketCaptureTargetType? ParsePacketCaptureTargetType(this string value) + { + switch( value ) + { + case "AzureVM": + return PacketCaptureTargetType.AzureVM; + case "AzureVMSS": + return PacketCaptureTargetType.AzureVMSS; + } + return null; + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchObject.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchObject.cs new file mode 100644 index 000000000000..799e3ee9fa96 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PatchObject.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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Object for patch operations. + /// + public partial class PatchObject + { + /// + /// Initializes a new instance of the PatchObject class. + /// + public PatchObject() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchObject class. + /// + /// Resource tags. + public PatchObject(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} 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..2f0f13cbc502 --- /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/ScopeConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ScopeConnection.cs new file mode 100644 index 000000000000..393f82ab2f7b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ScopeConnection.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// The Scope Connections resource + /// + [Rest.Serialization.JsonTransformation] + public partial class ScopeConnection : ChildResource + { + /// + /// Initializes a new instance of the ScopeConnection class. + /// + public ScopeConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScopeConnection class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// Tenant ID. + /// Resource ID. + /// Connection State. Possible values + /// include: 'Connected', 'Pending', 'Conflict', 'Revoked', + /// 'Rejected' + /// A description of the scope + /// connection. + /// The system metadata related to this + /// resource. + public ScopeConnection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), string resourceId = default(string), string connectionState = default(string), string description = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + TenantId = tenantId; + ResourceId = resourceId; + ConnectionState = connectionState; + Description = description; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets tenant ID. + /// + [JsonProperty(PropertyName = "properties.tenantId")] + public string TenantId { get; set; } + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets connection State. Possible values include: + /// 'Connected', 'Pending', 'Conflict', 'Revoked', 'Rejected' + /// + [JsonProperty(PropertyName = "properties.connectionState")] + public string ConnectionState { get; set; } + + /// + /// Gets or sets a description of the scope connection. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; 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/ScopeConnectionState.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ScopeConnectionState.cs new file mode 100644 index 000000000000..38ef04fb959b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ScopeConnectionState.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for ScopeConnectionState. + /// + public static class ScopeConnectionState + { + public const string Connected = "Connected"; + public const string Pending = "Pending"; + public const string Conflict = "Conflict"; + public const string Revoked = "Revoked"; + public const string Rejected = "Rejected"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityAdminConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityAdminConfiguration.cs new file mode 100644 index 000000000000..487ab9debc38 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityAdminConfiguration.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 security admin configuration + /// + [Rest.Serialization.JsonTransformation] + public partial class SecurityAdminConfiguration : ChildResource + { + /// + /// Initializes a new instance of the SecurityAdminConfiguration class. + /// + public SecurityAdminConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityAdminConfiguration class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A description of the security + /// configuration. + /// Enum list of + /// network intent policy based services. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public SecurityAdminConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), IList applyOnNetworkIntentPolicyBasedServices = default(IList), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + Description = description; + ApplyOnNetworkIntentPolicyBasedServices = applyOnNetworkIntentPolicyBasedServices; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a description of the security configuration. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets enum list of network intent policy based services. + /// + [JsonProperty(PropertyName = "properties.applyOnNetworkIntentPolicyBasedServices")] + public IList ApplyOnNetworkIntentPolicyBasedServices { 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/SecurityAdminConfigurationsDeleteHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityAdminConfigurationsDeleteHeaders.cs new file mode 100644 index 000000000000..4af57258105d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityAdminConfigurationsDeleteHeaders.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; + + /// + /// Defines headers for Delete operation. + /// + public partial class SecurityAdminConfigurationsDeleteHeaders + { + /// + /// Initializes a new instance of the + /// SecurityAdminConfigurationsDeleteHeaders class. + /// + public SecurityAdminConfigurationsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SecurityAdminConfigurationsDeleteHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + public SecurityAdminConfigurationsDeleteHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs new file mode 100644 index 000000000000..8fa24ddae16e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.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 SecurityConfigurationRuleAccess. + /// + public static class SecurityConfigurationRuleAccess + { + 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/StaticMember.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/StaticMember.cs new file mode 100644 index 000000000000..503a4d6d3a89 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/StaticMember.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// StaticMember Item. + /// + [Rest.Serialization.JsonTransformation] + public partial class StaticMember : ChildResource + { + /// + /// Initializes a new instance of the StaticMember class. + /// + public StaticMember() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StaticMember class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// Resource Id. + /// Resource region. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public StaticMember(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string resourceId = default(string), string region = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + ResourceId = resourceId; + Region = region; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource Id. + /// + [JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets resource region. + /// + [JsonProperty(PropertyName = "properties.region")] + public string Region { get; private 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/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/UseHubGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs new file mode 100644 index 000000000000..6bf6370a4632 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.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 UseHubGateway. + /// + public static class UseHubGateway + { + public const string False = "False"; + public const string True = "True"; + } +} 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 9518bf4c59cd..a72195cba787 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 @@ -79,11 +79,13 @@ public VirtualHub() /// The hubRoutingPreference of this /// VirtualHub. Possible values include: 'ExpressRoute', 'VpnGateway', /// 'ASPath' + /// The VirtualHub + /// Router autoscale configuration. /// A unique read-only string that changes whenever /// the resource is updated. /// Kind of service virtual hub. This is metadata /// used for the Azure portal experience for Route Server. - 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 hubRoutingPreference = default(string), string etag = default(string), string kind = 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 preferredRoutingGateway = default(string), string hubRoutingPreference = default(string), VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration = default(VirtualRouterAutoScaleConfiguration), string etag = default(string), string kind = default(string)) : base(id, name, type, location, tags) { VirtualWan = virtualWan; @@ -106,6 +108,7 @@ public VirtualHub() AllowBranchToBranchTraffic = allowBranchToBranchTraffic; PreferredRoutingGateway = preferredRoutingGateway; HubRoutingPreference = hubRoutingPreference; + VirtualRouterAutoScaleConfiguration = virtualRouterAutoScaleConfiguration; Etag = etag; Kind = kind; CustomInit(); @@ -243,6 +246,12 @@ public VirtualHub() [JsonProperty(PropertyName = "properties.hubRoutingPreference")] public string HubRoutingPreference { get; set; } + /// + /// Gets or sets the VirtualHub Router autoscale configuration. + /// + [JsonProperty(PropertyName = "properties.virtualRouterAutoScaleConfiguration")] + public VirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -273,6 +282,10 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); } + if (VirtualRouterAutoScaleConfiguration != null) + { + VirtualRouterAutoScaleConfiguration.Validate(); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterAutoScaleConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterAutoScaleConfiguration.cs new file mode 100644 index 000000000000..79b1dec3b71f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterAutoScaleConfiguration.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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The VirtualHub Router autoscale configuration. + /// + public partial class VirtualRouterAutoScaleConfiguration + { + /// + /// Initializes a new instance of the + /// VirtualRouterAutoScaleConfiguration class. + /// + public VirtualRouterAutoScaleConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualRouterAutoScaleConfiguration class. + /// + /// The minimum number of scale units for + /// VirtualHub Router. + public VirtualRouterAutoScaleConfiguration(int? minCapacity = default(int?)) + { + MinCapacity = minCapacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the minimum number of scale units for VirtualHub + /// Router. + /// + [JsonProperty(PropertyName = "minCapacity")] + public int? MinCapacity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MinCapacity < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinCapacity", 0); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs index b2cb0e1ac827..fe9471edcdc6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/WebApplicationFirewallOperator.cs @@ -27,5 +27,6 @@ public static class WebApplicationFirewallOperator public const string EndsWith = "EndsWith"; public const string Regex = "Regex"; public const string GeoMatch = "GeoMatch"; + public const string Any = "Any"; } } 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 fae2d54e57e4..0fa092904dc3 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 e679a6503fb7..ac7681a6bc5d 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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..2aba12626ee9 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs @@ -0,0 +1,1149 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("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. + /// + /// + /// 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 = "2022-01-01"; + // 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("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; + } + + /// + /// Deletes a network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("force", force); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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 (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// 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..a453460e00a5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for 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. + /// + 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. + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkGroupsDeleteHeaders Delete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?)) + { + return operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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; + } + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkGroupsDeleteHeaders BeginDelete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?)) + { + return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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 6fc9dbbc865b..ba1db61f7eab 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 a08d889964e3..fcef7a5cff20 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-08-01"; + string apiVersion = "2022-01-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 ac186d62dc43..ae966521b558 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -740,7 +740,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 ebeed2795723..216b874544f3 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2823,7 +2823,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3042,7 +3042,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3236,7 +3236,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 3da5026e244b..0b5b9bfb2edf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs @@ -323,6 +323,66 @@ 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 ISubscriptionNetworkManagerConnectionsOperations. + /// + public virtual ISubscriptionNetworkManagerConnectionsOperations SubscriptionNetworkManagerConnections { get; private set; } + + /// + /// Gets the IManagementGroupNetworkManagerConnectionsOperations. + /// + public virtual IManagementGroupNetworkManagerConnectionsOperations ManagementGroupNetworkManagerConnections { get; private set; } + + /// + /// Gets the IConnectivityConfigurationsOperations. + /// + public virtual IConnectivityConfigurationsOperations ConnectivityConfigurations { get; private set; } + + /// + /// Gets the INetworkGroupsOperations. + /// + public virtual INetworkGroupsOperations NetworkGroups { get; private set; } + + /// + /// Gets the IStaticMembersOperations. + /// + public virtual IStaticMembersOperations StaticMembers { get; private set; } + + /// + /// Gets the IScopeConnectionsOperations. + /// + public virtual IScopeConnectionsOperations ScopeConnections { 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 INetworkProfilesOperations. /// @@ -648,6 +708,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IWebApplicationFirewallPoliciesOperations WebApplicationFirewallPolicies { get; private set; } + /// + /// Gets the IExpressRouteProviderPortsLocationOperations. + /// + public virtual IExpressRouteProviderPortsLocationOperations ExpressRouteProviderPortsLocation { get; private set; } + /// /// Initializes a new instance of the NetworkManagementClient class. /// @@ -938,6 +1003,18 @@ 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); + SubscriptionNetworkManagerConnections = new SubscriptionNetworkManagerConnectionsOperations(this); + ManagementGroupNetworkManagerConnections = new ManagementGroupNetworkManagerConnectionsOperations(this); + ConnectivityConfigurations = new ConnectivityConfigurationsOperations(this); + NetworkGroups = new NetworkGroupsOperations(this); + StaticMembers = new StaticMembersOperations(this); + ScopeConnections = new ScopeConnectionsOperations(this); + SecurityAdminConfigurations = new SecurityAdminConfigurationsOperations(this); + AdminRuleCollections = new AdminRuleCollectionsOperations(this); + AdminRules = new AdminRulesOperations(this); NetworkProfiles = new NetworkProfilesOperations(this); NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); SecurityRules = new SecurityRulesOperations(this); @@ -1003,6 +1080,7 @@ private void Initialize() HubRouteTables = new HubRouteTablesOperations(this); RoutingIntent = new RoutingIntentOperations(this); WebApplicationFirewallPolicies = new WebApplicationFirewallPoliciesOperations(this); + ExpressRouteProviderPortsLocation = new ExpressRouteProviderPortsLocationOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; @@ -1037,6 +1115,12 @@ 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")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); @@ -1144,7 +1228,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1374,7 +1458,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "sessionIds"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1577,7 +1661,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1731,14 +1815,16 @@ private void Initialize() } /// - /// Gives the supported security providers for the virtual wan. + /// Lists active connectivity configurations in a network manager. /// + /// + /// Active Configuration Parameter. + /// /// - /// The resource group name. + /// The name of the resource group. /// - /// - /// The name of the VirtualWAN for which supported security providers are - /// needed. + /// + /// The name of the network manager. /// /// /// Headers that will be added to request. @@ -1761,8 +1847,12 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> SupportedSecurityProvidersWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListActiveConnectivityConfigurationsWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); @@ -1771,11 +1861,11 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualWANName == null) + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1783,18 +1873,19 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualWANName", virtualWANName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "SupportedSecurityProviders", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListActiveConnectivityConfigurations", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders").ToString(); + 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(SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualWANName}", System.Uri.EscapeDataString(virtualWANName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1807,7 +1898,7 @@ private void Initialize() // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (GenerateClientRequestId != null && GenerateClientRequestId.Value) @@ -1838,6 +1929,12 @@ private void Initialize() // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(parameters, 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 (Credentials != null) { @@ -1893,7 +1990,7 @@ private void Initialize() 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")) @@ -1906,7 +2003,7 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } catch (JsonException ex) { @@ -1926,32 +2023,1037 @@ private void Initialize() } /// - /// Generates a unique VPN profile for P2S clients for VirtualWan and - /// associated VpnServerConfiguration combination in the specified resource - /// group. + /// Lists active security admin rules in a network manager. /// - /// - /// The resource group name. + /// + /// Active Configuration Parameter. /// - /// - /// The name of the VirtualWAN whose associated VpnServerConfigurations is - /// needed. + /// + /// The name of the resource group. /// - /// - /// Parameters supplied to the generate VirtualWan VPN profile generation - /// operation. + /// + /// The name of the network manager. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListActiveSecurityAdminRulesWithHttpMessagesAsync(ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListActiveSecurityAdminRules", tracingParameters); + } + // Construct URL + var _baseUrl = 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(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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = SafeJsonConvert.SerializeObject(parameters, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + string apiVersion = "2022-01-01"; + // 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("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkManagerEffectiveConnectivityConfigurations", tracingParameters); + } + // Construct URL + var _baseUrl = 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(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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = SafeJsonConvert.SerializeObject(parameters, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 effective security admin rules applied on a virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + string apiVersion = "2022-01-01"; + // 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("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkManagerEffectiveSecurityAdminRules", tracingParameters); + } + // Construct URL + var _baseUrl = 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(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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = SafeJsonConvert.SerializeObject(parameters, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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; + } + + /// + /// Gives the supported security providers for the virtual wan. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN for which supported security providers are + /// needed. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> SupportedSecurityProvidersWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualWANName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualWANName", virtualWANName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "SupportedSecurityProviders", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualWANName}", System.Uri.EscapeDataString(virtualWANName)); + 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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; + } + + /// + /// Generates a unique VPN profile for P2S clients for VirtualWan and + /// associated VpnServerConfiguration combination in the specified resource + /// group. + /// + /// + /// The resource group name. + /// + /// + /// The name of the VirtualWAN whose associated VpnServerConfigurations is + /// needed. + /// + /// + /// Parameters supplied to the generate VirtualWan VPN profile generation + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(string resourceGroupName, string virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGeneratevirtualwanvpnserverconfigurationvpnprofileWithHttpMessagesAsync(resourceGroupName, virtualWANName, vpnClientParams, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves detail of a provider port. + /// + /// + /// The name of the provider port. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> ExpressRouteProviderPortMethodWithHttpMessagesAsync(string providerport, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (providerport == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerport"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("providerport", providerport); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ExpressRouteProviderPortMethod", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}").ToString(); + _url = _url.Replace("{providerport}", System.Uri.EscapeDataString(providerport)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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; } /// @@ -2005,7 +3107,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2211,7 +3313,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2394,7 +3496,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2599,7 +3701,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "vpnClientParams"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClientExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClientExtensions.cs index 2f4dcd7f3f61..b406d3270974 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClientExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClientExtensions.cs @@ -290,6 +290,192 @@ public static DnsNameAvailabilityResult CheckDnsNameAvailability(this INetworkMa } } + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static ActiveConnectivityConfigurationsListResult ListActiveConnectivityConfigurations(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName) + { + return operations.ListActiveConnectivityConfigurationsAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task ListActiveConnectivityConfigurationsAsync(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListActiveConnectivityConfigurationsWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static ActiveSecurityAdminRulesListResult ListActiveSecurityAdminRules(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName) + { + return operations.ListActiveSecurityAdminRulesAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task ListActiveSecurityAdminRulesAsync(this INetworkManagementClient operations, ActiveConfigurationParameter parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListActiveSecurityAdminRulesWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static NetworkManagerEffectiveConnectivityConfigurationListResult ListNetworkManagerEffectiveConnectivityConfigurations(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName) + { + return operations.ListNetworkManagerEffectiveConnectivityConfigurationsAsync(parameters, resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async Task ListNetworkManagerEffectiveConnectivityConfigurationsAsync(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkManagerEffectiveConnectivityConfigurationsWithHttpMessagesAsync(parameters, resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + public static NetworkManagerEffectiveSecurityAdminRulesListResult ListNetworkManagerEffectiveSecurityAdminRules(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName) + { + return operations.ListNetworkManagerEffectiveSecurityAdminRulesAsync(parameters, resourceGroupName, virtualNetworkName).GetAwaiter().GetResult(); + } + + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The cancellation token. + /// + public static async Task ListNetworkManagerEffectiveSecurityAdminRulesAsync(this INetworkManagementClient operations, QueryRequestOptions parameters, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkManagerEffectiveSecurityAdminRulesWithHttpMessagesAsync(parameters, resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gives the supported security providers for the virtual wan. /// @@ -386,6 +572,40 @@ public static VpnProfileResponse Generatevirtualwanvpnserverconfigurationvpnprof } } + /// + /// Retrieves detail of a provider port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the provider port. + /// + public static ExpressRouteProviderPort ExpressRouteProviderPortMethod(this INetworkManagementClient operations, string providerport) + { + return operations.ExpressRouteProviderPortMethodAsync(providerport).GetAwaiter().GetResult(); + } + + /// + /// Retrieves detail of a provider port. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the provider port. + /// + /// + /// The cancellation token. + /// + public static async Task ExpressRouteProviderPortMethodAsync(this INetworkManagementClient operations, string providerport, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ExpressRouteProviderPortMethodWithHttpMessagesAsync(providerport, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates a Bastion Shareable Links for all the VMs specified in the request. /// 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..29b621ef07e1 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs @@ -0,0 +1,322 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginPostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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> BeginPostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2022-01-01"; + // 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, "BeginPost", 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 != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // 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); + } + } + 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; + } + + } +} 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..f78cfa320e13 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + } + } + + /// + /// 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 BeginPost(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName) + { + return operations.BeginPostAsync(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 BeginPostAsync(this INetworkManagerCommitsOperations operations, NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginPostWithHttpMessagesAsync(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..74cd9728387e --- /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 = "2022-01-01"; + // 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/NetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs new file mode 100644 index 000000000000..41bf81992ffa --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs @@ -0,0 +1,1672 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("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 (parameters != null) + { + parameters.Validate(); + } + 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 = "2022-01-01"; + // 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Patch NetworkManager. + /// + /// + /// 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> PatchWithHttpMessagesAsync(PatchObject 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 = "2022-01-01"; + // 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, "Patch", 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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; + } + + /// + /// Deletes a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, bool? force = default(bool?), 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("force", force); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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 (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// 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..4149facc5895 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs @@ -0,0 +1,427 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkManagersDeleteHeaders Delete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?)) + { + return operations.DeleteAsync(resourceGroupName, networkManagerName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Patch NetworkManager. + /// + /// + /// 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 Patch(this INetworkManagersOperations operations, PatchObject parameters, string resourceGroupName, string networkManagerName) + { + return operations.PatchAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Patch NetworkManager. + /// + /// + /// 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 PatchAsync(this INetworkManagersOperations operations, PatchObject parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchWithHttpMessagesAsync(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; + } + } + + /// + /// Deletes a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static NetworkManagersDeleteHeaders BeginDelete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?)) + { + return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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 68813928e826..35a41d5c4662 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 b315425ba428..d70df5520ed2 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 ee42f0767614..eb88e066a733 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 e2dd4d8a3340..d7e6457a5174 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 1167685bbff1..087529bbcbbc 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-08-01"; + string apiVersion = "2022-01-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 5eebf86390c5..49a5031d0d42 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 02cf718d1c4d..bf641fa1c8bf 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 b25d7d962d24..54abf9a34ef5 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 ca9954af101c..aa7f68da5fa2 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 cc75f705925f..e2577ab4251d 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -864,7 +864,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 17941cdbdad0..e3c3472f04ed 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,7 +911,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1366,7 +1366,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1559,7 +1559,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1750,7 +1750,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1928,7 +1928,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2147,7 +2147,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2320,7 +2320,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2527,7 +2527,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 7f8f3fac1cd9..ebda648d8a28 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 index 55e419465d6a..7317fdf8f7b1 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2401,7 +2401,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 e0331463c070..b16961996585 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-08-01"; + string apiVersion = "2022-01-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 49b650b69069..a36053d2f34b 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 d8669ca6be07..b7f08ffaec63 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 04b8665b53b5..5bf47d46a4f3 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 42d2470a6d4d..6ef42809be27 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutingIntentOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutingIntentOperations.cs index 57624395f72b..b71168a589c3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutingIntentOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutingIntentOperations.cs @@ -130,7 +130,7 @@ internal RoutingIntentOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal RoutingIntentOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -561,7 +561,7 @@ internal RoutingIntentOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentParameters"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -786,7 +786,7 @@ internal RoutingIntentOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routingIntentName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ScopeConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ScopeConnectionsOperations.cs new file mode 100644 index 000000000000..0973f6fcbebd --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ScopeConnectionsOperations.cs @@ -0,0 +1,1069 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// ScopeConnectionsOperations operations. + /// + internal partial class ScopeConnectionsOperations : IServiceOperations, IScopeConnectionsOperations + { + /// + /// Initializes a new instance of the ScopeConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ScopeConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Creates or updates scope connection from Network Manager + /// + /// + /// Scope connection to be created/updated. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName, 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 (scopeConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeConnectionName"); + } + string apiVersion = "2022-01-01"; + // 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("scopeConnectionName", scopeConnectionName); + 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}/scopeConnections/{scopeConnectionName}").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("{scopeConnectionName}", System.Uri.EscapeDataString(scopeConnectionName)); + 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; + } + + /// + /// Get specified scope connection created by this Network Manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, 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 (scopeConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("scopeConnectionName", scopeConnectionName); + 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}/scopeConnections/{scopeConnectionName}").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("{scopeConnectionName}", System.Uri.EscapeDataString(scopeConnectionName)); + 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; + } + + /// + /// Delete the pending scope connection created by this network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string scopeConnectionName, 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 (scopeConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("scopeConnectionName", scopeConnectionName); + 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}/scopeConnections/{scopeConnectionName}").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("{scopeConnectionName}", System.Uri.EscapeDataString(scopeConnectionName)); + 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 scope connections created by this 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("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}/scopeConnections").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; + } + + /// + /// List all scope connections created by this network manager. + /// + /// + /// 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/ScopeConnectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ScopeConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..a09347ad417f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ScopeConnectionsOperationsExtensions.cs @@ -0,0 +1,260 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 ScopeConnectionsOperations. + /// + public static partial class ScopeConnectionsOperationsExtensions + { + /// + /// Creates or updates scope connection from Network Manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope connection to be created/updated. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + public static ScopeConnection CreateOrUpdate(this IScopeConnectionsOperations operations, ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates scope connection from Network Manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope connection to be created/updated. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IScopeConnectionsOperations operations, ScopeConnection parameters, string resourceGroupName, string networkManagerName, string scopeConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get specified scope connection created by this Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + public static ScopeConnection Get(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get specified scope connection created by this Network Manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the pending scope connection created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + public static void Delete(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, scopeConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete the pending scope connection created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Name for the cross-tenant connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, string scopeConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, scopeConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all scope connections created by this 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 IScopeConnectionsOperations operations, string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all scope connections created by this 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 IScopeConnectionsOperations 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; + } + } + + /// + /// List all scope connections created by this network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IScopeConnectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all scope connections created by this 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 IScopeConnectionsOperations 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/SdkInfo_NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs index b1325709ef52..20457422f6e0 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,133 +20,151 @@ public static IEnumerable> ApiInfo_NetworkManageme return new Tuple[] { new Tuple("Compute", "NetworkInterfaces", "2018-10-01"), - new Tuple("Compute", "NetworkInterfaces", "2021-08-01"), + new Tuple("Compute", "NetworkInterfaces", "2022-01-01"), new Tuple("Compute", "PublicIPAddresses", "2018-10-01"), - new Tuple("Compute", "PublicIPAddresses", "2021-08-01"), - new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2021-08-01"), - new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2021-08-01"), - new Tuple("Network", "ApplicationGateways", "2021-08-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2021-08-01"), - new Tuple("Network", "AvailableDelegations", "2021-08-01"), - new Tuple("Network", "AvailableEndpointServices", "2021-08-01"), - new Tuple("Network", "AvailablePrivateEndpointTypes", "2021-08-01"), - new Tuple("Network", "AvailableResourceGroupDelegations", "2021-08-01"), - new Tuple("Network", "AvailableServiceAliases", "2021-08-01"), - new Tuple("Network", "AzureFirewallFqdnTags", "2021-08-01"), - new Tuple("Network", "AzureFirewalls", "2021-08-01"), - new Tuple("Network", "BastionHosts", "2021-08-01"), - new Tuple("Network", "BgpServiceCommunities", "2021-08-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2021-08-01"), - new Tuple("Network", "ConfigurationPolicyGroups", "2021-08-01"), - new Tuple("Network", "ConnectionMonitors", "2021-08-01"), - new Tuple("Network", "CustomIPPrefixes", "2021-08-01"), - new Tuple("Network", "DdosCustomPolicies", "2021-08-01"), - new Tuple("Network", "DdosProtectionPlans", "2021-08-01"), - new Tuple("Network", "DefaultSecurityRules", "2021-08-01"), - new Tuple("Network", "DeleteBastionShareableLink", "2021-08-01"), - new Tuple("Network", "DisconnectActiveSessions", "2021-08-01"), - new Tuple("Network", "DscpConfiguration", "2021-08-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2021-08-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2021-08-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2021-08-01"), - new Tuple("Network", "ExpressRouteCircuits", "2021-08-01"), - new Tuple("Network", "ExpressRouteConnections", "2021-08-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2021-08-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2021-08-01"), - new Tuple("Network", "ExpressRouteGateways", "2021-08-01"), - new Tuple("Network", "ExpressRouteLinks", "2021-08-01"), - new Tuple("Network", "ExpressRoutePortAuthorizations", "2021-08-01"), - new Tuple("Network", "ExpressRoutePorts", "2021-08-01"), - new Tuple("Network", "ExpressRoutePortsLocations", "2021-08-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2021-08-01"), - new Tuple("Network", "FirewallPolicies", "2021-08-01"), - new Tuple("Network", "FirewallPolicyIdpsSignatures", "2021-08-01"), - new Tuple("Network", "FirewallPolicyIdpsSignaturesFilterValues", "2021-08-01"), - new Tuple("Network", "FirewallPolicyIdpsSignaturesOverrides", "2021-08-01"), - new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2021-08-01"), - new Tuple("Network", "FlowLogs", "2021-08-01"), - new Tuple("Network", "GetActiveSessions", "2021-08-01"), - new Tuple("Network", "GetBastionShareableLink", "2021-08-01"), - new Tuple("Network", "HubRouteTables", "2021-08-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2021-08-01"), - new Tuple("Network", "InboundNatRules", "2021-08-01"), - new Tuple("Network", "InboundSecurityRule", "2021-08-01"), - new Tuple("Network", "IpAllocations", "2021-08-01"), - new Tuple("Network", "IpGroups", "2021-08-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2021-08-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2021-08-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2021-08-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2021-08-01"), - new Tuple("Network", "LoadBalancerOutboundRules", "2021-08-01"), - new Tuple("Network", "LoadBalancerProbes", "2021-08-01"), - new Tuple("Network", "LoadBalancers", "2021-08-01"), - new Tuple("Network", "LocalNetworkGateways", "2021-08-01"), - new Tuple("Network", "NatGateways", "2021-08-01"), - new Tuple("Network", "NatRules", "2021-08-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2021-08-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2021-08-01"), - new Tuple("Network", "NetworkInterfaceTapConfigurations", "2021-08-01"), - new Tuple("Network", "NetworkInterfaces", "2021-08-01"), - new Tuple("Network", "NetworkProfiles", "2021-08-01"), - new Tuple("Network", "NetworkSecurityGroups", "2021-08-01"), - new Tuple("Network", "NetworkVirtualAppliances", "2021-08-01"), - new Tuple("Network", "NetworkWatchers", "2021-08-01"), - new Tuple("Network", "Operations", "2021-08-01"), - new Tuple("Network", "P2SVpnGateways", "2021-08-01"), - new Tuple("Network", "P2sVpnGateways", "2021-08-01"), - new Tuple("Network", "PacketCaptures", "2021-08-01"), - new Tuple("Network", "PeerExpressRouteCircuitConnections", "2021-08-01"), - new Tuple("Network", "PrivateDnsZoneGroups", "2021-08-01"), - new Tuple("Network", "PrivateEndpoints", "2021-08-01"), - new Tuple("Network", "PrivateLinkServices", "2021-08-01"), - new Tuple("Network", "PublicIPAddresses", "2021-08-01"), - new Tuple("Network", "PublicIPPrefixes", "2021-08-01"), - new Tuple("Network", "PutBastionShareableLink", "2021-08-01"), - new Tuple("Network", "ResourceNavigationLinks", "2021-08-01"), - new Tuple("Network", "RouteFilterRules", "2021-08-01"), - new Tuple("Network", "RouteFilters", "2021-08-01"), - new Tuple("Network", "RouteTables", "2021-08-01"), - new Tuple("Network", "Routes", "2021-08-01"), - new Tuple("Network", "RoutingIntent", "2021-08-01"), - new Tuple("Network", "SecurityPartnerProviders", "2021-08-01"), - new Tuple("Network", "SecurityRules", "2021-08-01"), - new Tuple("Network", "ServiceAssociationLinks", "2021-08-01"), - new Tuple("Network", "ServiceEndpointPolicies", "2021-08-01"), - new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2021-08-01"), - new Tuple("Network", "ServiceTagInformation", "2021-08-01"), - new Tuple("Network", "ServiceTags", "2021-08-01"), - new Tuple("Network", "Subnets", "2021-08-01"), - new Tuple("Network", "SupportedSecurityProviders", "2021-08-01"), - new Tuple("Network", "Usages", "2021-08-01"), - new Tuple("Network", "VirtualApplianceSites", "2021-08-01"), - new Tuple("Network", "VirtualApplianceSkus", "2021-08-01"), - new Tuple("Network", "VirtualHubBgpConnection", "2021-08-01"), - new Tuple("Network", "VirtualHubBgpConnections", "2021-08-01"), - new Tuple("Network", "VirtualHubIpConfiguration", "2021-08-01"), - new Tuple("Network", "VirtualHubRouteTableV2s", "2021-08-01"), - new Tuple("Network", "VirtualHubs", "2021-08-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2021-08-01"), - new Tuple("Network", "VirtualNetworkGatewayNatRules", "2021-08-01"), - new Tuple("Network", "VirtualNetworkGateways", "2021-08-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2021-08-01"), - new Tuple("Network", "VirtualNetworkTaps", "2021-08-01"), - new Tuple("Network", "VirtualNetworks", "2021-08-01"), - new Tuple("Network", "VirtualRouterPeerings", "2021-08-01"), - new Tuple("Network", "VirtualRouters", "2021-08-01"), - new Tuple("Network", "VirtualWans", "2021-08-01"), - new Tuple("Network", "VpnConnections", "2021-08-01"), - new Tuple("Network", "VpnGateways", "2021-08-01"), - new Tuple("Network", "VpnLinkConnections", "2021-08-01"), - new Tuple("Network", "VpnServerConfigurations", "2021-08-01"), - new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2021-08-01"), - new Tuple("Network", "VpnSiteLinkConnections", "2021-08-01"), - new Tuple("Network", "VpnSiteLinks", "2021-08-01"), - new Tuple("Network", "VpnSites", "2021-08-01"), - new Tuple("Network", "VpnSitesConfiguration", "2021-08-01"), - new Tuple("Network", "WebApplicationFirewallPolicies", "2021-08-01"), - new Tuple("Network", "WebCategories", "2021-08-01"), - new Tuple("Network", "configurationPolicyGroups", "2021-08-01"), - new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2021-08-01"), + new Tuple("Compute", "PublicIPAddresses", "2022-01-01"), + new Tuple("Management", "ManagementGroupNetworkManagerConnections", "2022-01-01"), + new Tuple("Network", "AdminRuleCollections", "2022-01-01"), + new Tuple("Network", "AdminRules", "2022-01-01"), + new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2022-01-01"), + new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2022-01-01"), + new Tuple("Network", "ApplicationGateways", "2022-01-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2022-01-01"), + new Tuple("Network", "AvailableDelegations", "2022-01-01"), + new Tuple("Network", "AvailableEndpointServices", "2022-01-01"), + new Tuple("Network", "AvailablePrivateEndpointTypes", "2022-01-01"), + new Tuple("Network", "AvailableResourceGroupDelegations", "2022-01-01"), + new Tuple("Network", "AvailableServiceAliases", "2022-01-01"), + new Tuple("Network", "AzureFirewallFqdnTags", "2022-01-01"), + new Tuple("Network", "AzureFirewalls", "2022-01-01"), + new Tuple("Network", "BastionHosts", "2022-01-01"), + new Tuple("Network", "BgpServiceCommunities", "2022-01-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2022-01-01"), + new Tuple("Network", "ConfigurationPolicyGroups", "2022-01-01"), + new Tuple("Network", "ConnectionMonitors", "2022-01-01"), + new Tuple("Network", "ConnectivityConfigurations", "2022-01-01"), + new Tuple("Network", "CustomIPPrefixes", "2022-01-01"), + new Tuple("Network", "DdosCustomPolicies", "2022-01-01"), + new Tuple("Network", "DdosProtectionPlans", "2022-01-01"), + new Tuple("Network", "DefaultSecurityRules", "2022-01-01"), + new Tuple("Network", "DeleteBastionShareableLink", "2022-01-01"), + new Tuple("Network", "DisconnectActiveSessions", "2022-01-01"), + new Tuple("Network", "DscpConfiguration", "2022-01-01"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2022-01-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2022-01-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2022-01-01"), + new Tuple("Network", "ExpressRouteCircuits", "2022-01-01"), + new Tuple("Network", "ExpressRouteConnections", "2022-01-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2022-01-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2022-01-01"), + new Tuple("Network", "ExpressRouteGateways", "2022-01-01"), + new Tuple("Network", "ExpressRouteLinks", "2022-01-01"), + new Tuple("Network", "ExpressRoutePortAuthorizations", "2022-01-01"), + new Tuple("Network", "ExpressRoutePorts", "2022-01-01"), + new Tuple("Network", "ExpressRoutePortsLocations", "2022-01-01"), + new Tuple("Network", "ExpressRouteProviderPort", "2022-01-01"), + new Tuple("Network", "ExpressRouteProviderPortsLocation", "2022-01-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2022-01-01"), + new Tuple("Network", "FirewallPolicies", "2022-01-01"), + new Tuple("Network", "FirewallPolicyIdpsSignatures", "2022-01-01"), + new Tuple("Network", "FirewallPolicyIdpsSignaturesFilterValues", "2022-01-01"), + new Tuple("Network", "FirewallPolicyIdpsSignaturesOverrides", "2022-01-01"), + new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2022-01-01"), + new Tuple("Network", "FlowLogs", "2022-01-01"), + new Tuple("Network", "GetActiveSessions", "2022-01-01"), + new Tuple("Network", "GetBastionShareableLink", "2022-01-01"), + new Tuple("Network", "HubRouteTables", "2022-01-01"), + new Tuple("Network", "HubVirtualNetworkConnections", "2022-01-01"), + new Tuple("Network", "InboundNatRules", "2022-01-01"), + new Tuple("Network", "InboundSecurityRule", "2022-01-01"), + new Tuple("Network", "IpAllocations", "2022-01-01"), + new Tuple("Network", "IpGroups", "2022-01-01"), + new Tuple("Network", "ListActiveConnectivityConfigurations", "2022-01-01"), + new Tuple("Network", "ListActiveSecurityAdminRules", "2022-01-01"), + new Tuple("Network", "ListNetworkManagerEffectiveConnectivityConfigurations", "2022-01-01"), + new Tuple("Network", "ListNetworkManagerEffectiveSecurityAdminRules", "2022-01-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2022-01-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2022-01-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2022-01-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2022-01-01"), + new Tuple("Network", "LoadBalancerOutboundRules", "2022-01-01"), + new Tuple("Network", "LoadBalancerProbes", "2022-01-01"), + new Tuple("Network", "LoadBalancers", "2022-01-01"), + new Tuple("Network", "LocalNetworkGateways", "2022-01-01"), + new Tuple("Network", "NatGateways", "2022-01-01"), + new Tuple("Network", "NatRules", "2022-01-01"), + new Tuple("Network", "NetworkGroups", "2022-01-01"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2022-01-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2022-01-01"), + new Tuple("Network", "NetworkInterfaceTapConfigurations", "2022-01-01"), + new Tuple("Network", "NetworkInterfaces", "2022-01-01"), + new Tuple("Network", "NetworkManagerCommits", "2022-01-01"), + new Tuple("Network", "NetworkManagerDeploymentStatus", "2022-01-01"), + new Tuple("Network", "NetworkManagers", "2022-01-01"), + new Tuple("Network", "NetworkProfiles", "2022-01-01"), + new Tuple("Network", "NetworkSecurityGroups", "2022-01-01"), + new Tuple("Network", "NetworkVirtualAppliances", "2022-01-01"), + new Tuple("Network", "NetworkWatchers", "2022-01-01"), + new Tuple("Network", "Operations", "2022-01-01"), + new Tuple("Network", "P2SVpnGateways", "2022-01-01"), + new Tuple("Network", "P2sVpnGateways", "2022-01-01"), + new Tuple("Network", "PacketCaptures", "2022-01-01"), + new Tuple("Network", "PeerExpressRouteCircuitConnections", "2022-01-01"), + new Tuple("Network", "PrivateDnsZoneGroups", "2022-01-01"), + new Tuple("Network", "PrivateEndpoints", "2022-01-01"), + new Tuple("Network", "PrivateLinkServices", "2022-01-01"), + new Tuple("Network", "PublicIPAddresses", "2022-01-01"), + new Tuple("Network", "PublicIPPrefixes", "2022-01-01"), + new Tuple("Network", "PutBastionShareableLink", "2022-01-01"), + new Tuple("Network", "ResourceNavigationLinks", "2022-01-01"), + new Tuple("Network", "RouteFilterRules", "2022-01-01"), + new Tuple("Network", "RouteFilters", "2022-01-01"), + new Tuple("Network", "RouteTables", "2022-01-01"), + new Tuple("Network", "Routes", "2022-01-01"), + new Tuple("Network", "RoutingIntent", "2022-01-01"), + new Tuple("Network", "ScopeConnections", "2022-01-01"), + new Tuple("Network", "SecurityAdminConfigurations", "2022-01-01"), + new Tuple("Network", "SecurityPartnerProviders", "2022-01-01"), + new Tuple("Network", "SecurityRules", "2022-01-01"), + new Tuple("Network", "ServiceAssociationLinks", "2022-01-01"), + new Tuple("Network", "ServiceEndpointPolicies", "2022-01-01"), + new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2022-01-01"), + new Tuple("Network", "ServiceTagInformation", "2022-01-01"), + new Tuple("Network", "ServiceTags", "2022-01-01"), + new Tuple("Network", "StaticMembers", "2022-01-01"), + new Tuple("Network", "Subnets", "2022-01-01"), + new Tuple("Network", "SubscriptionNetworkManagerConnections", "2022-01-01"), + new Tuple("Network", "SupportedSecurityProviders", "2022-01-01"), + new Tuple("Network", "Usages", "2022-01-01"), + new Tuple("Network", "VirtualApplianceSites", "2022-01-01"), + new Tuple("Network", "VirtualApplianceSkus", "2022-01-01"), + new Tuple("Network", "VirtualHubBgpConnection", "2022-01-01"), + new Tuple("Network", "VirtualHubBgpConnections", "2022-01-01"), + new Tuple("Network", "VirtualHubIpConfiguration", "2022-01-01"), + new Tuple("Network", "VirtualHubRouteTableV2s", "2022-01-01"), + new Tuple("Network", "VirtualHubs", "2022-01-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2022-01-01"), + new Tuple("Network", "VirtualNetworkGatewayNatRules", "2022-01-01"), + new Tuple("Network", "VirtualNetworkGateways", "2022-01-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2022-01-01"), + new Tuple("Network", "VirtualNetworkTaps", "2022-01-01"), + new Tuple("Network", "VirtualNetworks", "2022-01-01"), + new Tuple("Network", "VirtualRouterPeerings", "2022-01-01"), + new Tuple("Network", "VirtualRouters", "2022-01-01"), + new Tuple("Network", "VirtualWans", "2022-01-01"), + new Tuple("Network", "VpnConnections", "2022-01-01"), + new Tuple("Network", "VpnGateways", "2022-01-01"), + new Tuple("Network", "VpnLinkConnections", "2022-01-01"), + new Tuple("Network", "VpnServerConfigurations", "2022-01-01"), + new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2022-01-01"), + new Tuple("Network", "VpnSiteLinkConnections", "2022-01-01"), + new Tuple("Network", "VpnSiteLinks", "2022-01-01"), + new Tuple("Network", "VpnSites", "2022-01-01"), + new Tuple("Network", "VpnSitesConfiguration", "2022-01-01"), + new Tuple("Network", "WebApplicationFirewallPolicies", "2022-01-01"), + new Tuple("Network", "WebCategories", "2022-01-01"), + new Tuple("Network", "configurationPolicyGroups", "2022-01-01"), + new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2022-01-01"), }.AsEnumerable(); } } 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..176b5e359dcf --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs @@ -0,0 +1,1124 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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(SecurityAdminConfiguration 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 = "2022-01-01"; + // 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), 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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("force", force); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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 (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// 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..c926d414774e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs @@ -0,0 +1,333 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 SecurityAdminConfiguration 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 SecurityAdminConfiguration CreateOrUpdate(this ISecurityAdminConfigurationsOperations operations, SecurityAdminConfiguration 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, SecurityAdminConfiguration 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static SecurityAdminConfigurationsDeleteHeaders Delete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + public static SecurityAdminConfigurationsDeleteHeaders BeginDelete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?)) + { + return operations.BeginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).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. + /// + /// + /// Deletes the resource even if it is part of a deployed configuration. If the + /// configuration has been deployed, the service will do a cleanup deployment + /// in the background, prior to the delete. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, force, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// 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 6264160b5d61..e1ea57770a9b 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 947c16c30f32..b523679de220 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs index 20a06544791e..e70cf9846194 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-08-01"; + string apiVersion = "2022-01-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 da90ac5da600..b4dfdb124960 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 1ce2fce818fd..02156180b440 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs index 212ff2cd8509..397ec365a2d0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs @@ -96,7 +96,7 @@ internal ServiceTagInformationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 4071edff65d6..6b598927b768 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/StaticMembersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/StaticMembersOperations.cs new file mode 100644 index 000000000000..3bf55f88e54d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/StaticMembersOperations.cs @@ -0,0 +1,1105 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// StaticMembersOperations operations. + /// + internal partial class StaticMembersOperations : IServiceOperations, IStaticMembersOperations + { + /// + /// Initializes a new instance of the StaticMembersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal StaticMembersOperations(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 static member. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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, string staticMemberName, 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 (staticMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticMemberName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("staticMemberName", staticMemberName); + 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}/staticMembers/{staticMemberName}").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)); + _url = _url.Replace("{staticMemberName}", System.Uri.EscapeDataString(staticMemberName)); + 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 static member. + /// + /// + /// Parameters supplied to the specify the static member to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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(StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, 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"); + } + if (staticMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticMemberName"); + } + string apiVersion = "2022-01-01"; + // 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("networkGroupName", networkGroupName); + tracingParameters.Add("staticMemberName", staticMemberName); + 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}/staticMembers/{staticMemberName}").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)); + _url = _url.Replace("{staticMemberName}", System.Uri.EscapeDataString(staticMemberName)); + 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 static member. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// 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, string staticMemberName, 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 (staticMemberName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "staticMemberName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("staticMemberName", staticMemberName); + 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}/staticMembers/{staticMemberName}").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)); + _url = _url.Replace("{staticMemberName}", System.Uri.EscapeDataString(staticMemberName)); + 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 static member. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network 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, string networkManagerName, string networkGroupName, 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 (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + 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/{networkGroupName}/staticMembers").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 (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 static member. + /// + /// + /// 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/StaticMembersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/StaticMembersOperationsExtensions.cs new file mode 100644 index 000000000000..f0419de43e83 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/StaticMembersOperationsExtensions.cs @@ -0,0 +1,284 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 StaticMembersOperations. + /// + public static partial class StaticMembersOperationsExtensions + { + /// + /// Gets the specified static member. + /// + /// + /// 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. + /// + /// + /// The name of the static member. + /// + public static StaticMember Get(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified static member. + /// + /// + /// 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. + /// + /// + /// The name of the static member. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the specify the static member to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + public static StaticMember CreateOrUpdate(this IStaticMembersOperations operations, StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the specify the static member to create + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group. + /// + /// + /// The name of the static member. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IStaticMembersOperations operations, StaticMember parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a static member. + /// + /// + /// 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. + /// + /// + /// The name of the static member. + /// + public static void Delete(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a static member. + /// + /// + /// 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. + /// + /// + /// The name of the static member. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, string staticMemberName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists the specified static member. + /// + /// + /// 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. + /// + /// + /// 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 IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists the specified static member. + /// + /// + /// 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. + /// + /// + /// 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 IStaticMembersOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the specified static member. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IStaticMembersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the specified static member. + /// + /// + /// 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 IStaticMembersOperations 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/SubnetsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs index d9edb440d1c4..3ad74d99ecef 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubscriptionNetworkManagerConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubscriptionNetworkManagerConnectionsOperations.cs new file mode 100644 index 000000000000..4d4a80d3facb --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubscriptionNetworkManagerConnectionsOperations.cs @@ -0,0 +1,997 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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; + + /// + /// SubscriptionNetworkManagerConnectionsOperations operations. + /// + internal partial class SubscriptionNetworkManagerConnectionsOperations : IServiceOperations, ISubscriptionNetworkManagerConnectionsOperations + { + /// + /// Initializes a new instance of the SubscriptionNetworkManagerConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SubscriptionNetworkManagerConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Create a network manager connection on this subscription. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// Name for the network manager connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkManagerConnection parameters, string networkManagerConnectionName, 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 (networkManagerConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); + 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}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); + 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; + } + + /// + /// Get a specified connection created by this subscription. + /// + /// + /// Name for the network manager connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (networkManagerConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); + 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/networkManagerConnections/{networkManagerConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); + 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; + } + + /// + /// Delete specified connection created by this subscription. + /// + /// + /// Name for the network manager connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string networkManagerConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (networkManagerConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerConnectionName"); + } + string apiVersion = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("networkManagerConnectionName", networkManagerConnectionName); + 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}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{networkManagerConnectionName}", System.Uri.EscapeDataString(networkManagerConnectionName)); + 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 connections created by this 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>> ListWithHttpMessagesAsync(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 = "2022-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("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}/providers/Microsoft.Network/networkManagerConnections").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 all network manager connections created by this subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..6a4ef37a690c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubscriptionNetworkManagerConnectionsOperationsExtensions.cs @@ -0,0 +1,212 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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 SubscriptionNetworkManagerConnectionsOperations. + /// + public static partial class SubscriptionNetworkManagerConnectionsOperationsExtensions + { + /// + /// Create a network manager connection on this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection CreateOrUpdate(this ISubscriptionNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string networkManagerConnectionName) + { + return operations.CreateOrUpdateAsync(parameters, networkManagerConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Create a network manager connection on this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Network manager connection to be created/updated. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, NetworkManagerConnection parameters, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + public static NetworkManagerConnection Get(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName) + { + return operations.GetAsync(networkManagerConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get a specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + public static void Delete(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName) + { + operations.DeleteAsync(networkManagerConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete specified connection created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name for the network manager connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, string networkManagerConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(networkManagerConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all network manager connections created by this 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 List(this ISubscriptionNetworkManagerConnectionsOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all network manager connections created by this 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> ListAsync(this ISubscriptionNetworkManagerConnectionsOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISubscriptionNetworkManagerConnectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all network manager connections created by this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ISubscriptionNetworkManagerConnectionsOperations 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/UsagesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs index 3b39f5e147ca..19668899f3cf 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 01fd6faa2dc5..74fc026c5818 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 5792b7a07a22..86e2aed9e95e 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 a374d4e97e6c..a287ff7557d3 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +370,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { parameters.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 c016ece04659..14a0715d01e0 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 3d6e772f0cf1..e0df564fc1d5 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 5b347aea095f..a95d5612b0da 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 8edbed6becd7..48b501cc1e13 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -943,7 +943,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { virtualHubParameters.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 caa228a668cd..7ee69ea5869e 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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/VirtualNetworkGatewayNatRulesOperations.cs index 2110ca36b59b..adf8bc261952 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs @@ -101,7 +101,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs index d481f9e498ff..d5379f7e3734 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 3ca5bfb5dab2..75e79ccfef6b 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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -356,7 +356,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -554,7 +554,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -756,7 +756,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs index 916bd20518f4..01e59b7d2a38 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1084,7 +1084,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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 50cd2dafb99e..95ba26e8732b 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 0923849691b9..d4e7f0cd7290 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 651572ec4158..7d881fd6fa80 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 index d1a4bb5d3f20..5e1a857a21df 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 5cc712490447..699292564026 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 d47bd1d98266..2880ac5e27fa 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -808,7 +808,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { vpnGatewayParameters.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 5688e2912233..e372b8e17c04 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 d9a033c7b6e6..06251b5e4ca9 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-08-01"; + string apiVersion = "2022-01-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 ecf0f46d0ba2..b394897f5840 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 a7bca717df5e..53400235a24f 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-08-01"; + string apiVersion = "2022-01-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 90f98880e1a9..ee39154ebac5 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 652cbbb06885..cc0a85924246 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-08-01"; + string apiVersion = "2022-01-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 ae1402206b01..00c1b1f6b799 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -917,7 +917,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { vpnSiteParameters.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 745d59b751e5..daacede2c587 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -675,7 +675,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { parameters.Validate(); } - string apiVersion = "2021-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-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 66946774594a..1dff8ea82c8a 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-08-01"; + string apiVersion = "2022-01-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-08-01"; + string apiVersion = "2022-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj index 52ee4c37f750..bf837511d6f6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj @@ -10,7 +10,7 @@ Development of this library has shifted focus to the Azure Unified SDK. The future development will be focused on "Azure.ResourceManager.Network" (https://www.nuget.org/packages/Azure.ResourceManager.Network/). Please see the package changelog for more information. Microsoft.Azure.Management.Network - 22.0.0 + 23.0.0 Microsoft Azure Network management;Network;Network management;