diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs index 4e78ee9be9b6..e1c099fe2018 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// AccountBackupsOperations operations. /// - internal partial class AccountBackupsOperations : IServiceOperations, IAccountBackupsOperations + internal partial class AccountBackupsOperations : Microsoft.Rest.IServiceOperations, IAccountBackupsOperations { /// /// Initializes a new instance of the AccountBackupsOperations class. @@ -36,26 +24,23 @@ internal partial class AccountBackupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) + internal AccountBackupsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// List Backups for a Netapp Account - /// - /// /// List all Backups for a Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -68,13 +53,13 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,103 +68,104 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -191,55 +177,56 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,9 +236,10 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -262,31 +250,32 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get Backup for a Netapp Account - /// - /// /// Gets the specified backup for a Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -302,13 +291,13 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -317,116 +306,117 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("backupName", backupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -438,55 +428,56 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -496,9 +487,10 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -509,31 +501,32 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete Backup for a Netapp Account - /// - /// /// Delete the specified Backup for a Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -544,24 +537,21 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// The name of the backup /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete Backup for a Netapp Account - /// - /// /// Delete the specified Backup for a Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -577,10 +567,10 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -589,116 +579,117 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("backupName", backupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -710,55 +701,56 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -768,19 +760,24 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs index d4ab92c8cd9e..504c45c9137c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs @@ -1,223 +1,184 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AccountBackupsOperations. + /// Extension methods for AccountBackupsOperations /// public static partial class AccountBackupsOperationsExtensions { - /// - /// List Backups for a Netapp Account - /// - /// - /// List all Backups for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static IEnumerable List(this IAccountBackupsOperations operations, string resourceGroupName, string accountName) - { - return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// List Backups for a Netapp Account - /// - /// - /// List all Backups for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get Backup for a Netapp Account - /// - /// - /// Gets the specified backup for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the backup - /// - public static Backup Get(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName) - { - return operations.GetAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult(); - } + /// + /// List all Backups for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static System.Collections.Generic.IEnumerable List(this IAccountBackupsOperations operations, string resourceGroupName, string accountName) + { + return ((IAccountBackupsOperations)operations).ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Get Backup for a Netapp Account - /// - /// - /// Gets the specified backup for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all Backups for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the specified backup for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the backup + /// + public static Backup Get(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName) + { + return ((IAccountBackupsOperations)operations).GetAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult(); + } - /// - /// Delete Backup for a Netapp Account - /// - /// - /// Delete the specified Backup for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the backup - /// - public static void Delete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName) + /// + /// Gets the specified backup for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete the specified Backup for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the backup + /// + public static void Delete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName) + { + ((IAccountBackupsOperations)operations).DeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult(); + } - /// - /// Delete Backup for a Netapp Account - /// - /// - /// Delete the specified Backup for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Delete Backup for a Netapp Account - /// - /// - /// Delete the specified Backup for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the backup - /// - public static void BeginDelete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName) - { - operations.BeginDeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult(); - } - - /// - /// Delete Backup for a Netapp Account - /// - /// - /// Delete the specified Backup for a Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete the specified Backup for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Delete the specified Backup for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the backup + /// + public static void BeginDelete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName) + { + ((IAccountBackupsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult(); + } + /// + /// Delete the specified Backup for a Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs index 2b98ead09fbe..fbab4418bf85 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// AccountsOperations operations. /// - internal partial class AccountsOperations : IServiceOperations, IAccountsOperations + internal partial class AccountsOperations : Microsoft.Rest.IServiceOperations, IAccountsOperations { /// /// Initializes a new instance of the AccountsOperations class. @@ -36,39 +24,36 @@ internal partial class AccountsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AccountsOperations(AzureNetAppFilesManagementClient client) + internal AccountsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Describe all NetApp Accounts in a subscription - /// - /// /// List and describe all NetApp accounts in the subscription. - /// + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,73 +62,74 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -155,55 +141,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -213,9 +200,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -226,31 +214,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe all NetApp Accounts in a resource group - /// - /// /// List and describe all NetApp accounts in the resource group. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -260,13 +249,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -275,90 +264,91 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -370,55 +360,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -428,9 +419,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -441,31 +433,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a NetApp Account - /// - /// /// Get the NetApp account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -478,13 +471,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -493,103 +486,104 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -601,55 +595,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -659,9 +654,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -672,59 +668,57 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create or update a NetApp account - /// - /// /// Create or update the specified NetApp account within the resource group - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(NetAppAccount body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccount body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a NetApp account - /// - /// /// Delete the specified NetApp account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -732,54 +726,46 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// The name of the NetApp account /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a NetApp account - /// - /// /// Patch the specified NetApp account - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccountPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Renew identity credentials + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. /// - /// - /// Renew identity credentials that are used to authenticate to key vault, for - /// customer-managed key encryption. If encryption.identity.principalId does - /// not match identity.principalId, running this operation will fix it. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -787,46 +773,43 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// The name of the NetApp account /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a NetApp account - /// - /// /// Create or update the specified NetApp account within the resource group - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the 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 /// /// @@ -835,112 +818,113 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(NetAppAccount body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccount body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -952,61 +936,62 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1016,9 +1001,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1029,16 +1015,16 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1047,31 +1033,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a NetApp account - /// - /// /// Delete the specified NetApp account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1084,10 +1071,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1096,103 +1083,104 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1204,55 +1192,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1262,48 +1251,50 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Update a NetApp account - /// - /// /// Patch the specified NetApp account - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the 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 /// /// @@ -1312,108 +1303,109 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccountPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1425,61 +1417,62 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1489,9 +1482,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1502,16 +1496,16 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1520,33 +1514,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Renew identity credentials + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. /// - /// - /// Renew identity credentials that are used to authenticate to key vault, for - /// customer-managed key encryption. If encryption.identity.principalId does - /// not match identity.principalId, running this operation will fix it. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1559,10 +1552,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1571,103 +1564,104 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRenewCredentials", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRenewCredentials", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/renewCredentials").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1679,55 +1673,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1737,26 +1732,28 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe all NetApp Accounts in a subscription - /// - /// /// List and describe all NetApp accounts in the subscription. - /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1766,13 +1763,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1781,51 +1778,54 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1837,55 +1837,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1895,9 +1896,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1908,31 +1910,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe all NetApp Accounts in a resource group - /// - /// /// List and describe all NetApp accounts in the resource group. - /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1942,13 +1945,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1957,51 +1960,54 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2013,55 +2019,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2071,9 +2078,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -2084,24 +2092,28 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperationsExtensions.cs index 22c9152f528c..c0195d861ed4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperationsExtensions.cs @@ -1,613 +1,481 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AccountsOperations. + /// Extension methods for AccountsOperations /// public static partial class AccountsOperationsExtensions { - /// - /// Describe all NetApp Accounts in a subscription - /// - /// - /// List and describe all NetApp accounts in the subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IAccountsOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Describe all NetApp Accounts in a subscription - /// - /// - /// List and describe all NetApp accounts in the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe all NetApp Accounts in a resource group - /// - /// - /// List and describe all NetApp accounts in the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage List(this IAccountsOperations operations, string resourceGroupName) - { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Describe all NetApp Accounts in a resource group - /// - /// - /// List and describe all NetApp accounts in the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IAccountsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe a NetApp Account - /// - /// - /// Get the NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static NetAppAccount Get(this IAccountsOperations operations, string resourceGroupName, string accountName) - { - return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Describe a NetApp Account - /// - /// - /// Get the NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a NetApp account - /// - /// - /// Create or update the specified NetApp account within the resource group - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static NetAppAccount CreateOrUpdate(this IAccountsOperations operations, NetAppAccount body, string resourceGroupName, string accountName) - { - return operations.CreateOrUpdateAsync(body, resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Create or update a NetApp account - /// - /// - /// Create or update the specified NetApp account within the resource group - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAccountsOperations operations, NetAppAccount body, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List and describe all NetApp accounts in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IAccountsOperations operations) + { + return ((IAccountsOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// Delete a NetApp account - /// - /// - /// Delete the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static void Delete(this IAccountsOperations operations, string resourceGroupName, string accountName) + /// + /// List and describe all NetApp accounts in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IAccountsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List and describe all NetApp accounts in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage List(this IAccountsOperations operations, string resourceGroupName) + { + return ((IAccountsOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Delete a NetApp account - /// - /// - /// Delete the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List and describe all NetApp accounts in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IAccountsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Get the NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static NetAppAccount Get(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + return ((IAccountsOperations)operations).GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Update a NetApp account - /// - /// - /// Patch the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static NetAppAccount Update(this IAccountsOperations operations, NetAppAccountPatch body, string resourceGroupName, string accountName) + /// + /// Get the NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(body, resourceGroupName, accountName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update the specified NetApp account within the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static NetAppAccount CreateOrUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccount body) + { + return ((IAccountsOperations)operations).CreateOrUpdateAsync(resourceGroupName, accountName, body).GetAwaiter().GetResult(); + } - /// - /// Update a NetApp account - /// - /// - /// Patch the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IAccountsOperations operations, NetAppAccountPatch body, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update the specified NetApp account within the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccount body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static void Delete(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + ((IAccountsOperations)operations).DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Renew identity credentials - /// - /// - /// Renew identity credentials that are used to authenticate to key vault, for - /// customer-managed key encryption. If encryption.identity.principalId does - /// not match identity.principalId, running this operation will fix it. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static void RenewCredentials(this IAccountsOperations operations, string resourceGroupName, string accountName) - { - operations.RenewCredentialsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Renew identity credentials - /// - /// - /// Renew identity credentials that are used to authenticate to key vault, for - /// customer-managed key encryption. If encryption.identity.principalId does - /// not match identity.principalId, running this operation will fix it. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task RenewCredentialsAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or update a NetApp account - /// - /// - /// Create or update the specified NetApp account within the resource group - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static NetAppAccount BeginCreateOrUpdate(this IAccountsOperations operations, NetAppAccount body, string resourceGroupName, string accountName) - { - return operations.BeginCreateOrUpdateAsync(body, resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Create or update a NetApp account - /// - /// - /// Create or update the specified NetApp account within the resource group - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IAccountsOperations operations, NetAppAccount body, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a NetApp account - /// - /// - /// Delete the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static void BeginDelete(this IAccountsOperations operations, string resourceGroupName, string accountName) - { - operations.BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Delete a NetApp account - /// - /// - /// Delete the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Patch the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static NetAppAccount Update(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccountPatch body) + { + return ((IAccountsOperations)operations).UpdateAsync(resourceGroupName, accountName, body).GetAwaiter().GetResult(); + } - /// - /// Update a NetApp account - /// - /// - /// Patch the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static NetAppAccount BeginUpdate(this IAccountsOperations operations, NetAppAccountPatch body, string resourceGroupName, string accountName) + /// + /// Patch the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccountPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static void RenewCredentials(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + ((IAccountsOperations)operations).RenewCredentialsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Update a NetApp account - /// - /// - /// Patch the specified NetApp account - /// - /// - /// The operations group for this extension method. - /// - /// - /// NetApp Account object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IAccountsOperations operations, NetAppAccountPatch body, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RenewCredentialsAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update the specified NetApp account within the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static NetAppAccount BeginCreateOrUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccount body) + { + return ((IAccountsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, accountName, body).GetAwaiter().GetResult(); + } - /// - /// Renew identity credentials - /// - /// - /// Renew identity credentials that are used to authenticate to key vault, for - /// customer-managed key encryption. If encryption.identity.principalId does - /// not match identity.principalId, running this operation will fix it. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static void BeginRenewCredentials(this IAccountsOperations operations, string resourceGroupName, string accountName) + /// + /// Create or update the specified NetApp account within the resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccount body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginRenewCredentialsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static void BeginDelete(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + ((IAccountsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Renew identity credentials - /// - /// - /// Renew identity credentials that are used to authenticate to key vault, for - /// customer-managed key encryption. If encryption.identity.principalId does - /// not match identity.principalId, running this operation will fix it. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task BeginRenewCredentialsAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Patch the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static NetAppAccount BeginUpdate(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccountPatch body) + { + return ((IAccountsOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, body).GetAwaiter().GetResult(); + } - /// - /// Describe all NetApp Accounts in a subscription - /// - /// - /// List and describe all NetApp accounts in the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IAccountsOperations operations, string nextPageLink) + /// + /// Patch the specified NetApp account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, NetAppAccountPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static void BeginRenewCredentials(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + ((IAccountsOperations)operations).BeginRenewCredentialsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Describe all NetApp Accounts in a subscription - /// - /// - /// List and describe all NetApp accounts in the 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 IAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRenewCredentialsAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List and describe all NetApp accounts in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IAccountsOperations operations, string nextPageLink) + { + return ((IAccountsOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Describe all NetApp Accounts in a resource group - /// - /// - /// List and describe all NetApp accounts in the resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAccountsOperations operations, string nextPageLink) + /// + /// List and describe all NetApp accounts in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List and describe all NetApp accounts in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IAccountsOperations operations, string nextPageLink) + { + return ((IAccountsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Describe all NetApp Accounts in a resource group - /// - /// - /// List and describe all NetApp accounts in the 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 IAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List and describe all NetApp accounts in the 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 System.Threading.Tasks.Task> ListNextAsync(this IAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperations.cs index b20082d82fa0..182b4a2143e4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// BackupPoliciesOperations operations. /// - internal partial class BackupPoliciesOperations : IServiceOperations, IBackupPoliciesOperations + internal partial class BackupPoliciesOperations : Microsoft.Rest.IServiceOperations, IBackupPoliciesOperations { /// /// Initializes a new instance of the BackupPoliciesOperations class. @@ -36,26 +24,23 @@ internal partial class BackupPoliciesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) + internal BackupPoliciesOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// List backup policies - /// - /// /// List backup policies for Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -68,13 +53,13 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,103 +68,104 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -191,55 +177,56 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,9 +236,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -262,31 +250,32 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get a backup Policy - /// - /// /// Get a particular backup Policy - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -302,13 +291,13 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -317,109 +306,111 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupPolicyName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("backupPolicyName", backupPolicyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{backupPolicyName}", System.Uri.EscapeDataString(backupPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -431,55 +422,56 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -489,9 +481,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -502,31 +495,32 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create a backup policy - /// - /// /// Create a backup policy for Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -540,24 +534,21 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// Backup policy object supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Patch a backup policy - /// - /// /// Patch a backup policy for Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -571,24 +562,21 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// Backup policy object supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a backup policy - /// - /// /// Delete backup policy - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -599,24 +587,21 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// Backup policy Name which uniquely identify backup policy. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create a backup policy - /// - /// /// Create a backup policy for Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -635,13 +620,13 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -650,118 +635,120 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId != null) + if (body != null) { - if (Client.SubscriptionId.Length < 1) + body.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) + + if (this.Client.ApiVersion == null) { - body.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("backupPolicyName", backupPolicyName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{backupPolicyName}", System.Uri.EscapeDataString(backupPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -773,61 +760,62 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -837,9 +825,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -850,16 +839,16 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -868,31 +857,32 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Patch a backup policy - /// - /// /// Patch a backup policy for Netapp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -911,13 +901,13 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -926,114 +916,116 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("backupPolicyName", backupPolicyName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{backupPolicyName}", System.Uri.EscapeDataString(backupPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1045,61 +1037,62 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1109,9 +1102,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1122,16 +1116,16 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1140,31 +1134,32 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a backup policy - /// - /// /// Delete backup policy - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1180,10 +1175,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1192,109 +1187,111 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("backupPolicyName", backupPolicyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{backupPolicyName}", System.Uri.EscapeDataString(backupPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1306,55 +1303,56 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1364,19 +1362,24 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs index b48e043515a5..dafb4ecd022e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs @@ -1,455 +1,364 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for BackupPoliciesOperations. + /// Extension methods for BackupPoliciesOperations /// public static partial class BackupPoliciesOperationsExtensions { - /// - /// List backup policies - /// - /// - /// List backup policies for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static IEnumerable List(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName) - { - return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// List backup policies - /// - /// - /// List backup policies for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a backup Policy - /// - /// - /// Get a particular backup Policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - public static BackupPolicy Get(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName) - { - return operations.GetAsync(resourceGroupName, accountName, backupPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Get a backup Policy - /// - /// - /// Get a particular backup Policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create a backup policy - /// - /// - /// Create a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - public static BackupPolicy Create(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body) - { - return operations.CreateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); - } + /// + /// List backup policies for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static System.Collections.Generic.IEnumerable List(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName) + { + return ((IBackupPoliciesOperations)operations).ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Create a backup policy - /// - /// - /// Create a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List backup policies for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get a particular backup Policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static BackupPolicy Get(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName) + { + return ((IBackupPoliciesOperations)operations).GetAsync(resourceGroupName, accountName, backupPolicyName).GetAwaiter().GetResult(); + } - /// - /// Patch a backup policy - /// - /// - /// Patch a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - public static BackupPolicy Update(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body) + /// + /// Get a particular backup Policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static BackupPolicy Create(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body) + { + return ((IBackupPoliciesOperations)operations).CreateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Patch a backup policy - /// - /// - /// Patch a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static BackupPolicy Update(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body) + { + return ((IBackupPoliciesOperations)operations).UpdateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a backup policy - /// - /// - /// Delete backup policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - public static void Delete(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName) + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, backupPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete backup policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static void Delete(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName) + { + ((IBackupPoliciesOperations)operations).DeleteAsync(resourceGroupName, accountName, backupPolicyName).GetAwaiter().GetResult(); + } - /// - /// Delete a backup policy - /// - /// - /// Delete backup policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a backup policy - /// - /// - /// Create a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - public static BackupPolicy BeginCreate(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body) - { - return operations.BeginCreateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); - } - - /// - /// Create a backup policy - /// - /// - /// Create a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Patch a backup policy - /// - /// - /// Patch a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - public static BackupPolicy BeginUpdate(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body) - { - return operations.BeginUpdateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); - } - - /// - /// Patch a backup policy - /// - /// - /// Patch a backup policy for Netapp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// Backup policy object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete backup policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static BackupPolicy BeginCreate(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body) + { + return ((IBackupPoliciesOperations)operations).BeginCreateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a backup policy - /// - /// - /// Delete backup policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - public static void BeginDelete(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName) + /// + /// Create a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, accountName, backupPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static BackupPolicy BeginUpdate(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body) + { + return ((IBackupPoliciesOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a backup policy - /// - /// - /// Delete backup policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete backup policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + public static void BeginDelete(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName) + { + ((IBackupPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, backupPolicyName).GetAwaiter().GetResult(); + } + /// + /// Delete backup policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperations.cs index 8f4b8cd49cbc..59eb6f8be7ed 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// BackupsOperations operations. /// - internal partial class BackupsOperations : IServiceOperations, IBackupsOperations + internal partial class BackupsOperations : Microsoft.Rest.IServiceOperations, IBackupsOperations { /// /// Initializes a new instance of the BackupsOperations class. @@ -36,26 +24,23 @@ internal partial class BackupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BackupsOperations(AzureNetAppFilesManagementClient client) + internal BackupsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Get volume's backup status - /// - /// /// Get the status of the backup for a volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,13 +59,13 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -89,145 +74,146 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -239,55 +225,56 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -297,9 +284,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -310,31 +298,32 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get volume's restore status - /// - /// /// Get the status of the restore for a volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -353,13 +342,13 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -368,145 +357,146 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVolumeRestoreStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetVolumeRestoreStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVolumeRestoreStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetVolumeRestoreStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -518,55 +508,56 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -576,9 +567,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -589,31 +581,32 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// List Backups - /// - /// /// List all backups for a volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -632,13 +625,13 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -647,145 +640,146 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -797,55 +791,56 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -855,9 +850,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -868,31 +864,32 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get a backup - /// - /// /// Gets the specified backup of the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -914,13 +911,13 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -929,158 +926,159 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("backupName", backupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1092,55 +1090,56 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1150,9 +1149,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1163,31 +1163,32 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create a backup - /// - /// /// Create a backup for the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1207,24 +1208,21 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// Backup object supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Patch a backup - /// - /// /// Patch a backup for the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1244,24 +1242,21 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// Backup object supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete backup - /// - /// /// Delete a backup of the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1278,28 +1273,21 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// The name of the backup /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create a new Backup Restore Files request + /// Restore the specified files from the specified backup to the active filesystem /// - /// - /// Restore the specified files from the specified backup to the active - /// filesystem - /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1315,25 +1303,25 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the backup /// + /// + /// Restore payload supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> RestoreFilesWithHttpMessagesAsync(BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginRestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, backupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRestoreFilesWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create a backup - /// - /// /// Create a backup for the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1358,13 +1346,13 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1373,167 +1361,168 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId != null) + if (body != null) { - if (Client.SubscriptionId.Length < 1) + body.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) - { - body.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("backupName", backupName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1545,61 +1534,62 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1609,9 +1599,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1622,16 +1613,16 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1640,31 +1631,32 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Patch a backup - /// - /// /// Patch a backup for the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1689,13 +1681,13 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1704,159 +1696,160 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("backupName", backupName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1868,61 +1861,62 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1932,9 +1926,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1945,16 +1940,16 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1963,31 +1958,32 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete backup - /// - /// /// Delete a backup of the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2009,10 +2005,10 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2021,158 +2017,159 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("backupName", backupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2184,55 +2181,56 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2242,30 +2240,28 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create a new Backup Restore Files request + /// Restore the specified files from the specified backup to the active filesystem /// - /// - /// Restore the specified files from the specified backup to the active - /// filesystem - /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2281,16 +2277,19 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the backup /// + /// + /// Restore payload supplied in the body of the operation. + /// /// /// 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 /// /// @@ -2299,167 +2298,168 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginRestoreFilesWithHttpMessagesAsync(BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginRestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (backupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName"); } if (backupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("backupName", backupName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFiles", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFiles", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2471,61 +2471,62 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2535,32 +2536,37 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.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)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperationsExtensions.cs index e36da3f04930..02a069922318 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/BackupsOperationsExtensions.cs @@ -1,811 +1,676 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for BackupsOperations. + /// Extension methods for BackupsOperations /// public static partial class BackupsOperationsExtensions { - /// - /// Get volume's backup status - /// - /// - /// Get the status of the backup for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static BackupStatus GetStatus(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.GetStatusAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } + /// + /// Get the status of the backup for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static BackupStatus GetStatus(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IBackupsOperations)operations).GetStatusAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } - /// - /// Get volume's backup status - /// - /// - /// Get the status of the backup for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task GetStatusAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the status of the backup for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetStatusAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetStatusWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetStatusWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get the status of the restore for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static RestoreStatus GetVolumeRestoreStatus(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IBackupsOperations)operations).GetVolumeRestoreStatusAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } - /// - /// Get volume's restore status - /// - /// - /// Get the status of the restore for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static RestoreStatus GetVolumeRestoreStatus(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + /// + /// Get the status of the restore for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetVolumeRestoreStatusAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetVolumeRestoreStatusWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetVolumeRestoreStatusAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List all backups for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static System.Collections.Generic.IEnumerable List(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IBackupsOperations)operations).ListAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } - /// - /// Get volume's restore status - /// - /// - /// Get the status of the restore for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task GetVolumeRestoreStatusAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all backups for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetVolumeRestoreStatusWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the specified backup of the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static Backup Get(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) + { + return ((IBackupsOperations)operations).GetAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); + } - /// - /// List Backups - /// - /// - /// List all backups for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static IEnumerable List(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + /// + /// Gets the specified backup of the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static Backup Create(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body) + { + return ((IBackupsOperations)operations).CreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + } - /// - /// List Backups - /// - /// - /// List all backups for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Patch a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static Backup Update(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch)) + { + return ((IBackupsOperations)operations).UpdateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + } - /// - /// Get a backup - /// - /// - /// Gets the specified backup of the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - public static Backup Get(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) + /// + /// Patch a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete a backup of the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static void Delete(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) + { + ((IBackupsOperations)operations).DeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); + } - /// - /// Get a backup - /// - /// - /// Gets the specified backup of the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a backup of the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restore the specified files from the specified backup to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static BackupsRestoreFilesHeaders RestoreFiles(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body) + { + return ((IBackupsOperations)operations).RestoreFilesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + } - /// - /// Create a backup - /// - /// - /// Create a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - public static Backup Create(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body) + /// + /// Restore the specified files from the specified backup to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RestoreFilesAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RestoreFilesWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + return _result.Headers; } + } + /// + /// Create a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static Backup BeginCreate(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body) + { + return ((IBackupsOperations)operations).BeginCreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + } - /// - /// Create a backup - /// - /// - /// Create a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Patch a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static Backup BeginUpdate(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch)) + { + return ((IBackupsOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + } - /// - /// Patch a backup - /// - /// - /// Patch a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - public static Backup Update(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch)) + /// + /// Patch a backup for the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete a backup of the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static void BeginDelete(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) + { + ((IBackupsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); + } - /// - /// Patch a backup - /// - /// - /// Patch a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete a backup of the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restore the specified files from the specified backup to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + public static BackupsRestoreFilesHeaders BeginRestoreFiles(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body) + { + return ((IBackupsOperations)operations).BeginRestoreFilesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); + } - /// - /// Delete backup - /// - /// - /// Delete a backup of the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - public static void Delete(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) + /// + /// Restore the specified files from the specified backup to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the backup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRestoreFilesAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginRestoreFilesWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); + return _result.Headers; } - - /// - /// Delete backup - /// - /// - /// Delete a backup of the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a new Backup Restore Files request - /// - /// - /// Restore the specified files from the specified backup to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - public static BackupsRestoreFilesHeaders RestoreFiles(this IBackupsOperations operations, BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) - { - return operations.RestoreFilesAsync(body, resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); - } - - /// - /// Create a new Backup Restore Files request - /// - /// - /// Restore the specified files from the specified backup to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task RestoreFilesAsync(this IBackupsOperations operations, BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Create a backup - /// - /// - /// Create a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - public static Backup BeginCreate(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body) - { - return operations.BeginCreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); - } - - /// - /// Create a backup - /// - /// - /// Create a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Patch a backup - /// - /// - /// Patch a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - public static Backup BeginUpdate(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch)) - { - return operations.BeginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).GetAwaiter().GetResult(); - } - - /// - /// Patch a backup - /// - /// - /// Patch a backup for the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// Backup object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete backup - /// - /// - /// Delete a backup of the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - public static void BeginDelete(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) - { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); - } - - /// - /// Delete backup - /// - /// - /// Delete a backup of the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a new Backup Restore Files request - /// - /// - /// Restore the specified files from the specified backup to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - public static BackupsRestoreFilesHeaders BeginRestoreFiles(this IBackupsOperations operations, BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName) - { - return operations.BeginRestoreFilesAsync(body, resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult(); - } - - /// - /// Create a new Backup Restore Files request - /// - /// - /// Restore the specified files from the specified backup to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the backup - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestoreFilesAsync(this IBackupsOperations operations, BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginRestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, backupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountBackupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountBackupsOperations.cs index 184f78e39b7d..a82fed66a448 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountBackupsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountBackupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AccountBackupsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IAccountBackupsOperations { /// - /// List Backups for a Netapp Account + /// List all Backups for a Netapp Account /// /// /// List all Backups for a Netapp Account @@ -47,12 +37,10 @@ public partial interface IAccountBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get Backup for a Netapp Account + /// Gets the specified backup for a Netapp Account /// /// /// Gets the specified backup for a Netapp Account @@ -78,12 +66,10 @@ public partial interface IAccountBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// Delete the specified Backup for a Netapp Account @@ -106,12 +92,10 @@ public partial interface IAccountBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// Delete the specified Backup for a Netapp Account @@ -134,9 +118,7 @@ public partial interface IAccountBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountsOperations.cs index 97beb61f61ec..d5b9d9bd28c4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAccountsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AccountsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IAccountsOperations { /// - /// Describe all NetApp Accounts in a subscription + /// List and describe all NetApp accounts in the subscription. /// /// /// List and describe all NetApp accounts in the subscription. @@ -41,12 +31,10 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe all NetApp Accounts in a resource group + /// List and describe all NetApp accounts in the resource group. /// /// /// List and describe all NetApp accounts in the resource group. @@ -66,12 +54,10 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a NetApp Account + /// Get the NetApp account /// /// /// Get the NetApp account @@ -94,26 +80,23 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or update a NetApp account + /// Create or update the specified NetApp account within the resource group /// /// - /// Create or update the specified NetApp account within the resource - /// group + /// Create or update the specified NetApp account within the resource group /// - /// - /// NetApp Account object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -126,12 +109,10 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(NetAppAccount body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccount body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a NetApp account + /// Delete the specified NetApp account /// /// /// Delete the specified NetApp account @@ -151,25 +132,23 @@ public partial interface IAccountsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a NetApp account + /// Patch the specified NetApp account /// /// /// Patch the specified NetApp account /// - /// - /// NetApp Account object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -182,18 +161,13 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccountPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Renew identity credentials + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. /// /// - /// Renew identity credentials that are used to authenticate to key - /// vault, for customer-managed key encryption. If - /// encryption.identity.principalId does not match - /// identity.principalId, running this operation will fix it. + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. /// /// /// The name of the resource group. The name is case insensitive. @@ -210,26 +184,23 @@ public partial interface IAccountsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or update a NetApp account + /// Create or update the specified NetApp account within the resource group /// /// - /// Create or update the specified NetApp account within the resource - /// group + /// Create or update the specified NetApp account within the resource group /// - /// - /// NetApp Account object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -242,12 +213,10 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(NetAppAccount body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccount body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a NetApp account + /// Delete the specified NetApp account /// /// /// Delete the specified NetApp account @@ -267,25 +236,23 @@ public partial interface IAccountsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a NetApp account + /// Patch the specified NetApp account /// /// /// Patch the specified NetApp account /// - /// - /// NetApp Account object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// The name of the NetApp account /// + /// + /// NetApp Account object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -298,18 +265,13 @@ public partial interface IAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccountPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Renew identity credentials + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. /// /// - /// Renew identity credentials that are used to authenticate to key - /// vault, for customer-managed key encryption. If - /// encryption.identity.principalId does not match - /// identity.principalId, running this operation will fix it. + /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it. /// /// /// The name of the resource group. The name is case insensitive. @@ -326,12 +288,10 @@ public partial interface IAccountsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe all NetApp Accounts in a subscription + /// List and describe all NetApp accounts in the subscription. /// /// /// List and describe all NetApp accounts in the subscription. @@ -351,12 +311,10 @@ public partial interface IAccountsOperations /// /// 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)); + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe all NetApp Accounts in a resource group + /// List and describe all NetApp accounts in the resource group. /// /// /// List and describe all NetApp accounts in the resource group. @@ -376,9 +334,7 @@ public partial interface IAccountsOperations /// /// 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)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupPoliciesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupPoliciesOperations.cs index 8106bbad52c3..fa6662e863a9 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupPoliciesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupPoliciesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// BackupPoliciesOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IBackupPoliciesOperations { /// - /// List backup policies + /// List backup policies for Netapp Account /// /// /// List backup policies for Netapp Account @@ -47,12 +37,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get a backup Policy + /// Get a particular backup Policy /// /// /// Get a particular backup Policy @@ -78,12 +66,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a backup policy + /// Create a backup policy for Netapp Account /// /// /// Create a backup policy for Netapp Account @@ -112,12 +98,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Patch a backup policy + /// Patch a backup policy for Netapp Account /// /// /// Patch a backup policy for Netapp Account @@ -146,12 +130,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a backup policy + /// Delete backup policy /// /// /// Delete backup policy @@ -174,12 +156,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a backup policy + /// Create a backup policy for Netapp Account /// /// /// Create a backup policy for Netapp Account @@ -208,12 +188,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Patch a backup policy + /// Patch a backup policy for Netapp Account /// /// /// Patch a backup policy for Netapp Account @@ -242,12 +220,10 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a backup policy + /// Delete backup policy /// /// /// Delete backup policy @@ -270,9 +246,7 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupsOperations.cs index c64ebc47c62f..bdffe5cfceeb 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IBackupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// BackupsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IBackupsOperations { /// - /// Get volume's backup status + /// Get the status of the backup for a volume /// /// /// Get the status of the backup for a volume @@ -53,12 +43,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get volume's restore status + /// Get the status of the restore for a volume /// /// /// Get the status of the restore for a volume @@ -87,12 +75,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetVolumeRestoreStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetVolumeRestoreStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List Backups + /// List all backups for a volume /// /// /// List all backups for a volume @@ -121,12 +107,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get a backup + /// Gets the specified backup of the volume /// /// /// Gets the specified backup of the volume @@ -158,12 +142,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a backup + /// Create a backup for the volume /// /// /// Create a backup for the volume @@ -198,12 +180,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Patch a backup + /// Patch a backup for the volume /// /// /// Patch a backup for the volume @@ -238,12 +218,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete backup + /// Delete a backup of the volume /// /// /// Delete a backup of the volume @@ -272,20 +250,14 @@ public partial interface IBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a new Backup Restore Files request + /// Restore the specified files from the specified backup to the active filesystem /// /// - /// Restore the specified files from the specified backup to the active - /// filesystem + /// Restore the specified files from the specified backup to the active filesystem /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -301,6 +273,9 @@ public partial interface IBackupsOperations /// /// The name of the backup /// + /// + /// Restore payload supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -310,12 +285,10 @@ public partial interface IBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> RestoreFilesWithHttpMessagesAsync(BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a backup + /// Create a backup for the volume /// /// /// Create a backup for the volume @@ -350,12 +323,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Patch a backup + /// Patch a backup for the volume /// /// /// Patch a backup for the volume @@ -390,12 +361,10 @@ public partial interface IBackupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete backup + /// Delete a backup of the volume /// /// /// Delete a backup of the volume @@ -424,20 +393,14 @@ public partial interface IBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a new Backup Restore Files request + /// Restore the specified files from the specified backup to the active filesystem /// /// - /// Restore the specified files from the specified backup to the active - /// filesystem + /// Restore the specified files from the specified backup to the active filesystem /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -453,6 +416,9 @@ public partial interface IBackupsOperations /// /// The name of the backup /// + /// + /// Restore payload supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -462,9 +428,7 @@ public partial interface IBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginRestoreFilesWithHttpMessagesAsync(BackupRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginRestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAzureNetAppFilesManagementClient.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppManagementClient.cs similarity index 69% rename from src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAzureNetAppFilesManagementClient.cs rename to src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppManagementClient.cs index 4d21f5c19fa2..2b0e9f53c6a0 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IAzureNetAppFilesManagementClient.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppManagementClient.cs @@ -1,24 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// /// Microsoft NetApp Files Azure Resource Provider specification /// - public partial interface IAzureNetAppFilesManagementClient : System.IDisposable + public partial interface INetAppManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -28,116 +22,121 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// /// The API version to use for this operation. /// - string ApiVersion { get; } + string ApiVersion { get;} + /// /// The ID of the target subscription. /// - string SubscriptionId { get; set; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// - /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the INetAppResourceOperations. + /// Gets the INetAppResourceOperations /// INetAppResourceOperations NetAppResource { get; } /// - /// Gets the INetAppResourceQuotaLimitsOperations. + /// Gets the INetAppResourceQuotaLimitsOperations /// INetAppResourceQuotaLimitsOperations NetAppResourceQuotaLimits { get; } /// - /// Gets the IAccountsOperations. + /// Gets the IAccountsOperations /// IAccountsOperations Accounts { get; } /// - /// Gets the IPoolsOperations. + /// Gets the IPoolsOperations /// IPoolsOperations Pools { get; } /// - /// Gets the IVolumesOperations. + /// Gets the IVolumesOperations /// IVolumesOperations Volumes { get; } /// - /// Gets the ISnapshotsOperations. + /// Gets the ISnapshotsOperations /// ISnapshotsOperations Snapshots { get; } /// - /// Gets the ISnapshotPoliciesOperations. + /// Gets the ISnapshotPoliciesOperations /// ISnapshotPoliciesOperations SnapshotPolicies { get; } /// - /// Gets the IBackupsOperations. + /// Gets the IBackupsOperations /// IBackupsOperations Backups { get; } /// - /// Gets the IAccountBackupsOperations. + /// Gets the IAccountBackupsOperations /// IAccountBackupsOperations AccountBackups { get; } /// - /// Gets the IBackupPoliciesOperations. + /// Gets the IBackupPoliciesOperations /// IBackupPoliciesOperations BackupPolicies { get; } /// - /// Gets the IVolumeQuotaRulesOperations. + /// Gets the IVolumeQuotaRulesOperations /// IVolumeQuotaRulesOperations VolumeQuotaRules { get; } /// - /// Gets the IVolumeGroupsOperations. + /// Gets the IVolumeGroupsOperations /// IVolumeGroupsOperations VolumeGroups { get; } /// - /// Gets the ISubvolumesOperations. + /// Gets the ISubvolumesOperations /// ISubvolumesOperations Subvolumes { get; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceOperations.cs index e1ff8618150a..8805ee10bd2f 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetAppResourceOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface INetAppResourceOperations { /// - /// Check resource name availability + /// Check if a resource name is available. /// /// /// Check if a resource name is available. @@ -36,11 +26,7 @@ public partial interface INetAppResourceOperations /// Resource name to verify. /// /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + /// Resource type used for verification. /// /// /// Resource group name. @@ -57,12 +43,10 @@ public partial interface INetAppResourceOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Check file path availability + /// Check if a file path is available. /// /// /// Check if a file path is available. @@ -74,8 +58,7 @@ public partial interface INetAppResourceOperations /// File path to verify. /// /// - /// The Azure Resource URI for a delegated subnet. Must have the - /// delegation Microsoft.NetApp/volumes + /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes /// /// /// The headers that will be added to request. @@ -89,12 +72,10 @@ public partial interface INetAppResourceOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckFilePathAvailabilityWithHttpMessagesAsync(string location, string name, string subnetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckFilePathAvailabilityWithHttpMessagesAsync(string location, string name, string subnetId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Check quota availability + /// Check if a quota is available. /// /// /// Check if a quota is available. @@ -106,11 +87,7 @@ public partial interface INetAppResourceOperations /// Name of the resource to verify. /// /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + /// Resource type used for verification. /// /// /// Resource group name. @@ -127,16 +104,13 @@ public partial interface INetAppResourceOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describes region specific information. + /// Provides storage to network proximity and logical zone mapping information. /// /// - /// Provides storage to network proximity and logical zone mapping - /// information. + /// Provides storage to network proximity and logical zone mapping information. /// /// /// The name of Azure region. @@ -153,9 +127,7 @@ public partial interface INetAppResourceOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> QueryRegionInfoWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> QueryRegionInfoWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceQuotaLimitsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceQuotaLimitsOperations.cs index 6f4294fa01b8..18a835bd21d4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceQuotaLimitsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/INetAppResourceQuotaLimitsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// NetAppResourceQuotaLimitsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface INetAppResourceQuotaLimitsOperations { /// - /// Get quota limits + /// Get the default and current limits for quotas /// /// /// Get the default and current limits for quotas @@ -44,12 +34,10 @@ public partial interface INetAppResourceQuotaLimitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get quota limits + /// Get the default and current subscription quota limit /// /// /// Get the default and current subscription quota limit @@ -72,9 +60,7 @@ public partial interface INetAppResourceQuotaLimitsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string quotaLimitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string quotaLimitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IOperations.cs index 18c17d8c820c..21ed2b352625 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IOperations { /// - /// Describes the Resource Provider + /// Lists all of the available Microsoft.NetApp Rest API operations /// /// /// Lists all of the available Microsoft.NetApp Rest API operations @@ -41,9 +31,7 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IPoolsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IPoolsOperations.cs index 2b970606b59e..b7d77434a438 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IPoolsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IPoolsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// PoolsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IPoolsOperations { /// - /// Describe all Capacity Pools + /// List all capacity pools in the NetApp Account /// /// /// List all capacity pools in the NetApp Account @@ -47,12 +37,10 @@ public partial interface IPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a Capacity Pool + /// Get details of the specified capacity pool /// /// /// Get details of the specified capacity pool @@ -78,20 +66,14 @@ public partial interface IPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or Update the specified capacity pool within the resource - /// group + /// Create or Update a capacity pool /// /// /// Create or Update a capacity pool /// - /// - /// Capacity pool object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -101,6 +83,9 @@ public partial interface IPoolsOperations /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -113,19 +98,14 @@ public partial interface IPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(CapacityPool body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPool body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a capacity pool + /// Patch the specified capacity pool /// /// /// Patch the specified capacity pool /// - /// - /// Capacity pool object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -135,6 +115,9 @@ public partial interface IPoolsOperations /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -147,12 +130,10 @@ public partial interface IPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a capacity pool + /// Delete the specified capacity pool /// /// /// Delete the specified capacity pool @@ -175,20 +156,14 @@ public partial interface IPoolsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or Update the specified capacity pool within the resource - /// group + /// Create or Update a capacity pool /// /// /// Create or Update a capacity pool /// - /// - /// Capacity pool object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -198,6 +173,9 @@ public partial interface IPoolsOperations /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -210,19 +188,14 @@ public partial interface IPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(CapacityPool body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPool body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a capacity pool + /// Patch the specified capacity pool /// /// /// Patch the specified capacity pool /// - /// - /// Capacity pool object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -232,6 +205,9 @@ public partial interface IPoolsOperations /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -244,12 +220,10 @@ public partial interface IPoolsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a capacity pool + /// Delete the specified capacity pool /// /// /// Delete the specified capacity pool @@ -272,12 +246,10 @@ public partial interface IPoolsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe all Capacity Pools + /// List all capacity pools in the NetApp Account /// /// /// List all capacity pools in the NetApp Account @@ -297,9 +269,7 @@ public partial interface IPoolsOperations /// /// 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)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotPoliciesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotPoliciesOperations.cs index cedda1151da2..ab3b07adf16b 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotPoliciesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotPoliciesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SnapshotPoliciesOperations operations. @@ -26,6 +16,9 @@ public partial interface ISnapshotPoliciesOperations /// /// List snapshot policy /// + /// + /// List snapshot policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get a snapshot Policy /// + /// + /// Get a snapshot Policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -72,16 +66,14 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create a snapshot policy /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// + /// + /// Create a snapshot policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -91,6 +83,9 @@ public partial interface ISnapshotPoliciesOperations /// /// The name of the snapshot policy /// + /// + /// Snapshot policy object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -103,16 +98,14 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(SnapshotPolicy body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicy body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Patch a snapshot policy /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// + /// + /// Patch a snapshot policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -122,6 +115,9 @@ public partial interface ISnapshotPoliciesOperations /// /// The name of the snapshot policy /// + /// + /// Snapshot policy object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -134,13 +130,14 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete snapshot policy /// + /// + /// Delete snapshot policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -159,12 +156,10 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get volumes for snapshot policy + /// Get volumes associated with snapshot policy /// /// /// Get volumes associated with snapshot policy @@ -190,16 +185,14 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListVolumesWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListVolumesWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Patch a snapshot policy /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// + /// + /// Patch a snapshot policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -209,6 +202,9 @@ public partial interface ISnapshotPoliciesOperations /// /// The name of the snapshot policy /// + /// + /// Snapshot policy object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -221,13 +217,14 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete snapshot policy /// + /// + /// Delete snapshot policy + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -246,9 +243,7 @@ public partial interface ISnapshotPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotsOperations.cs index c2b2d89900fd..7e7d15f5be8c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISnapshotsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SnapshotsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface ISnapshotsOperations { /// - /// Describe all snapshots + /// List all snapshots associated with the volume /// /// /// List all snapshots associated with the volume @@ -53,12 +43,10 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a snapshot + /// Get details of the specified snapshot /// /// /// Get details of the specified snapshot @@ -90,19 +78,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a snapshot + /// Create the specified snapshot within the given volume /// /// /// Create the specified snapshot within the given volume /// - /// - /// Snapshot object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -118,6 +101,9 @@ public partial interface ISnapshotsOperations /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -130,19 +116,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a snapshot + /// Patch a snapshot /// /// /// Patch a snapshot /// - /// - /// Snapshot object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -158,6 +139,9 @@ public partial interface ISnapshotsOperations /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -170,12 +154,10 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a snapshot + /// Delete snapshot /// /// /// Delete snapshot @@ -204,20 +186,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a new Snapshot Restore Files request + /// Restore the specified files from the specified snapshot to the active filesystem /// /// - /// Restore the specified files from the specified snapshot to the - /// active filesystem + /// Restore the specified files from the specified snapshot to the active filesystem /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -233,6 +209,9 @@ public partial interface ISnapshotsOperations /// /// The name of the snapshot /// + /// + /// Restore payload supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -242,19 +221,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a snapshot + /// Create the specified snapshot within the given volume /// /// /// Create the specified snapshot within the given volume /// - /// - /// Snapshot object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -270,6 +244,9 @@ public partial interface ISnapshotsOperations /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -282,19 +259,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a snapshot + /// Patch a snapshot /// /// /// Patch a snapshot /// - /// - /// Snapshot object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -310,6 +282,9 @@ public partial interface ISnapshotsOperations /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -322,12 +297,10 @@ public partial interface ISnapshotsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a snapshot + /// Delete snapshot /// /// /// Delete snapshot @@ -356,20 +329,14 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a new Snapshot Restore Files request + /// Restore the specified files from the specified snapshot to the active filesystem /// /// - /// Restore the specified files from the specified snapshot to the - /// active filesystem + /// Restore the specified files from the specified snapshot to the active filesystem /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -385,6 +352,9 @@ public partial interface ISnapshotsOperations /// /// The name of the snapshot /// + /// + /// Restore payload supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -394,9 +364,7 @@ public partial interface ISnapshotsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISubvolumesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISubvolumesOperations.cs index 8ada06bbab84..ceb74a178fce 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISubvolumesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/ISubvolumesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SubvolumesOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface ISubvolumesOperations { /// - /// List of all the subvolumes + /// Returns a list of the subvolumes in the volume /// /// /// Returns a list of the subvolumes in the volume @@ -53,12 +43,10 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the path associated with the subvolumeName + /// Returns the path associated with the subvolumeName provided /// /// /// Returns the path associated with the subvolumeName provided @@ -90,20 +78,14 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or clone a new subvolume + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath /// /// - /// Creates a subvolume in the path or clones the subvolume mentioned - /// in the parentPath + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath /// - /// - /// Subvolume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -119,6 +101,9 @@ public partial interface ISubvolumesOperations /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -131,19 +116,14 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a subvolume + /// Patch a subvolume /// /// /// Patch a subvolume /// - /// - /// Subvolume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -159,6 +139,9 @@ public partial interface ISubvolumesOperations /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -171,12 +154,10 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a subvolume + /// Delete subvolume /// /// /// Delete subvolume @@ -205,12 +186,10 @@ public partial interface ISubvolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a subvolume + /// Get details of the specified subvolume /// /// /// Get details of the specified subvolume @@ -242,20 +221,14 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or clone a new subvolume + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath /// /// - /// Creates a subvolume in the path or clones the subvolume mentioned - /// in the parentPath + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath /// - /// - /// Subvolume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -271,6 +244,9 @@ public partial interface ISubvolumesOperations /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -283,19 +259,14 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a subvolume + /// Patch a subvolume /// /// /// Patch a subvolume /// - /// - /// Subvolume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -311,6 +282,9 @@ public partial interface ISubvolumesOperations /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -323,12 +297,10 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a subvolume + /// Delete subvolume /// /// /// Delete subvolume @@ -357,12 +329,10 @@ public partial interface ISubvolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a subvolume + /// Get details of the specified subvolume /// /// /// Get details of the specified subvolume @@ -394,12 +364,10 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginGetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginGetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List of all the subvolumes + /// Returns a list of the subvolumes in the volume /// /// /// Returns a list of the subvolumes in the volume @@ -419,9 +387,7 @@ public partial interface ISubvolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVolumeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVolumeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeGroupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeGroupsOperations.cs index d500fb24e6d9..b1dc9cb9c946 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeGroupsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VolumeGroupsOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IVolumeGroupsOperations { /// - /// Describe all volume groups + /// List all volume groups for given account /// /// /// List all volume groups for given account @@ -47,12 +37,10 @@ public partial interface IVolumeGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByNetAppAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByNetAppAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a Volume Group + /// Get details of the specified volume group /// /// /// Get details of the specified volume group @@ -78,22 +66,14 @@ public partial interface IVolumeGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create the specified volume group and volumes. Creating volume - /// group will create all the volumes specified in request body - /// implicitly. Once volumes are created using volume group, those will - /// be treated as regular volumes thereafter. + /// Create a volume group along with specified volumes /// /// /// Create a volume group along with specified volumes /// - /// - /// Volume Group object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -103,6 +83,9 @@ public partial interface IVolumeGroupsOperations /// /// The name of the volumeGroup /// + /// + /// Volume Group object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -115,16 +98,13 @@ public partial interface IVolumeGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a volume group + /// Delete the specified volume group only if there are no volumes under volume group. /// /// - /// Delete the specified volume group only if there are no volumes - /// under volume group. + /// Delete the specified volume group only if there are no volumes under volume group. /// /// /// The name of the resource group. The name is case insensitive. @@ -144,22 +124,14 @@ public partial interface IVolumeGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create the specified volume group and volumes. Creating volume - /// group will create all the volumes specified in request body - /// implicitly. Once volumes are created using volume group, those will - /// be treated as regular volumes thereafter. + /// Create a volume group along with specified volumes /// /// /// Create a volume group along with specified volumes /// - /// - /// Volume Group object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -169,6 +141,9 @@ public partial interface IVolumeGroupsOperations /// /// The name of the volumeGroup /// + /// + /// Volume Group object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -181,16 +156,13 @@ public partial interface IVolumeGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a volume group + /// Delete the specified volume group only if there are no volumes under volume group. /// /// - /// Delete the specified volume group only if there are no volumes - /// under volume group. + /// Delete the specified volume group only if there are no volumes under volume group. /// /// /// The name of the resource group. The name is case insensitive. @@ -210,9 +182,7 @@ public partial interface IVolumeGroupsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeQuotaRulesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeQuotaRulesOperations.cs index bd6baf30fdbe..c48d8a068b9e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeQuotaRulesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumeQuotaRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VolumeQuotaRulesOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IVolumeQuotaRulesOperations { /// - /// Get all quota rules for a volume + /// List all quota rules associated with the volume /// /// /// List all quota rules associated with the volume @@ -53,12 +43,10 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a quota rule + /// Get details of the specified quota rule /// /// /// Get details of the specified quota rule @@ -90,19 +78,14 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a quota rule + /// Create the specified quota rule within the given volume /// /// /// Create the specified quota rule within the given volume /// - /// - /// Quota rule object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -118,6 +101,9 @@ public partial interface IVolumeQuotaRulesOperations /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -130,19 +116,14 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a quota rule + /// Patch a quota rule /// /// /// Patch a quota rule /// - /// - /// Quota rule object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -158,6 +139,9 @@ public partial interface IVolumeQuotaRulesOperations /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -170,12 +154,10 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a quota rule + /// Delete quota rule /// /// /// Delete quota rule @@ -204,19 +186,14 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create a quota rule + /// Create the specified quota rule within the given volume /// /// /// Create the specified quota rule within the given volume /// - /// - /// Quota rule object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -232,6 +209,9 @@ public partial interface IVolumeQuotaRulesOperations /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -244,19 +224,14 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a quota rule + /// Patch a quota rule /// /// /// Patch a quota rule /// - /// - /// Quota rule object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -272,6 +247,9 @@ public partial interface IVolumeQuotaRulesOperations /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -284,12 +262,10 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a quota rule + /// Delete quota rule /// /// /// Delete quota rule @@ -318,9 +294,7 @@ public partial interface IVolumeQuotaRulesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumesOperations.cs index 2112da5eded1..1115e7f13f92 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/IVolumesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// VolumesOperations operations. @@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.NetApp public partial interface IVolumesOperations { /// - /// Describe all volumes + /// List all volumes within the capacity pool /// /// /// List all volumes within the capacity pool @@ -50,12 +40,10 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe a volume + /// Get the details of the specified volume /// /// /// Get the details of the specified volume @@ -84,19 +72,14 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or Update a volume + /// Create or update the specified volume within the capacity pool /// /// /// Create or update the specified volume within the capacity pool /// - /// - /// Volume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -109,6 +92,9 @@ public partial interface IVolumesOperations /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -121,19 +107,14 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Volume body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a volume + /// Patch the specified volume /// /// /// Patch the specified volume /// - /// - /// Volume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -146,6 +127,9 @@ public partial interface IVolumesOperations /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -158,12 +142,10 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a volume + /// Delete the specified volume /// /// /// Delete the specified volume @@ -181,8 +163,7 @@ public partial interface IVolumesOperations /// The name of the volume /// /// - /// An option to force delete the volume. Will cleanup resources - /// connected to the particular volume + /// An option to force delete the volume. Will cleanup resources connected to the particular volume /// /// /// The headers that will be added to request. @@ -193,12 +174,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Revert a volume to one of its snapshots + /// Revert a volume to the snapshot specified in the body /// /// /// Revert a volume to the snapshot specified in the body @@ -216,8 +195,7 @@ public partial interface IVolumesOperations /// The name of the volume /// /// - /// Object for snapshot to revert supplied in the body of the - /// operation. + /// Object for snapshot to revert supplied in the body of the operation. /// /// /// The headers that will be added to request. @@ -228,12 +206,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reset cifs password + /// Reset cifs password from volume /// /// /// Reset cifs password from volume @@ -259,12 +235,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Break file locks + /// Break all the file locks on a volume /// /// /// Break all the file locks on a volume @@ -282,8 +256,7 @@ public partial interface IVolumesOperations /// The name of the volume /// /// - /// Optional body to provide the ability to clear file locks with - /// selected options + /// Optional body to provide the ability to clear file locks with selected options /// /// /// The headers that will be added to request. @@ -294,12 +267,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get Group Id List for LDAP User + /// Returns the list of group Ids for a specific LDAP User /// /// /// Returns the list of group Ids for a specific LDAP User @@ -325,18 +296,16 @@ public partial interface IVolumesOperations /// /// The cancellation 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> ListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Break volume replication + /// Break the replication connection on the destination volume /// /// /// Break the replication connection on the destination volume @@ -365,16 +334,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Re-establish volume replication + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots /// /// - /// Re-establish a previously deleted replication between 2 volumes - /// that have a common ad-hoc or policy-based snapshots + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots /// /// /// The name of the resource group. The name is case insensitive. @@ -400,12 +366,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get volume replication status + /// Get the status of the replication /// /// /// Get the status of the replication @@ -434,12 +398,10 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ReplicationStatusMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ReplicationStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List replications for volume + /// List all replications for a specified volume /// /// /// List all replications for a specified volume @@ -468,17 +430,13 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListReplicationsMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListReplicationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resync volume replication + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. /// /// - /// Resync the connection on the destination volume. If the operation - /// is ran on the source volume it will reverse-resync the connection - /// and sync from destination to source. + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. /// /// /// The name of the resource group. The name is case insensitive. @@ -501,16 +459,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete volume replication + /// Delete the replication connection on the destination volume, and send release to the source replication /// /// - /// Delete the replication connection on the destination volume, and - /// send release to the source replication + /// Delete the replication connection on the destination volume, and send release to the source replication /// /// /// The name of the resource group. The name is case insensitive. @@ -533,12 +488,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Authorize source volume replication + /// Authorize the replication connection on the source volume /// /// /// Authorize the replication connection on the source volume @@ -567,12 +520,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task AuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task AuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// ReInitialize volume replication + /// Re-Initializes the replication connection on the destination volume /// /// /// Re-Initializes the replication connection on the destination volume @@ -598,12 +549,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task ReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task ReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Change pool for volume + /// Moves volume to another pool /// /// /// Moves volume to another pool @@ -632,12 +581,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task PoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task PoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Relocate volume + /// Relocates volume to a new stamp /// /// /// Relocates volume to a new stamp @@ -666,16 +613,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Finalize volume relocation + /// Finalizes the relocation of the volume and cleans up the old volume. /// /// - /// Finalizes the relocation of the volume and cleans up the old - /// volume. + /// Finalizes the relocation of the volume and cleans up the old volume. /// /// /// The name of the resource group. The name is case insensitive. @@ -698,16 +642,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task FinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task FinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Revert volume relocation + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. /// /// - /// Reverts the volume relocation process, cleans up the new volume and - /// starts using the former-existing volume. + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. /// /// /// The name of the resource group. The name is case insensitive. @@ -730,19 +671,14 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task RevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task RevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Create or Update a volume + /// Create or update the specified volume within the capacity pool /// /// /// Create or update the specified volume within the capacity pool /// - /// - /// Volume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -755,6 +691,9 @@ public partial interface IVolumesOperations /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -767,19 +706,14 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Volume body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Update a volume + /// Patch the specified volume /// /// /// Patch the specified volume /// - /// - /// Volume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -792,6 +726,9 @@ public partial interface IVolumesOperations /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the operation. + /// /// /// The headers that will be added to request. /// @@ -804,12 +741,10 @@ public partial interface IVolumesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete a volume + /// Delete the specified volume /// /// /// Delete the specified volume @@ -827,8 +762,7 @@ public partial interface IVolumesOperations /// The name of the volume /// /// - /// An option to force delete the volume. Will cleanup resources - /// connected to the particular volume + /// An option to force delete the volume. Will cleanup resources connected to the particular volume /// /// /// The headers that will be added to request. @@ -839,12 +773,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Revert a volume to one of its snapshots + /// Revert a volume to the snapshot specified in the body /// /// /// Revert a volume to the snapshot specified in the body @@ -862,8 +794,7 @@ public partial interface IVolumesOperations /// The name of the volume /// /// - /// Object for snapshot to revert supplied in the body of the - /// operation. + /// Object for snapshot to revert supplied in the body of the operation. /// /// /// The headers that will be added to request. @@ -874,12 +805,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Reset cifs password + /// Reset cifs password from volume /// /// /// Reset cifs password from volume @@ -905,12 +834,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Break file locks + /// Break all the file locks on a volume /// /// /// Break all the file locks on a volume @@ -928,8 +855,7 @@ public partial interface IVolumesOperations /// The name of the volume /// /// - /// Optional body to provide the ability to clear file locks with - /// selected options + /// Optional body to provide the ability to clear file locks with selected options /// /// /// The headers that will be added to request. @@ -940,12 +866,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginBreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginBreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get Group Id List for LDAP User + /// Returns the list of group Ids for a specific LDAP User /// /// /// Returns the list of group Ids for a specific LDAP User @@ -971,18 +895,16 @@ public partial interface IVolumesOperations /// /// The cancellation 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> BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Break volume replication + /// Break the replication connection on the destination volume /// /// /// Break the replication connection on the destination volume @@ -1011,16 +933,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Re-establish volume replication + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots /// /// - /// Re-establish a previously deleted replication between 2 volumes - /// that have a common ad-hoc or policy-based snapshots + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots /// /// /// The name of the resource group. The name is case insensitive. @@ -1046,17 +965,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Resync volume replication + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. /// /// - /// Resync the connection on the destination volume. If the operation - /// is ran on the source volume it will reverse-resync the connection - /// and sync from destination to source. + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. /// /// /// The name of the resource group. The name is case insensitive. @@ -1079,16 +994,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Delete volume replication + /// Delete the replication connection on the destination volume, and send release to the source replication /// /// - /// Delete the replication connection on the destination volume, and - /// send release to the source replication + /// Delete the replication connection on the destination volume, and send release to the source replication /// /// /// The name of the resource group. The name is case insensitive. @@ -1111,12 +1023,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Authorize source volume replication + /// Authorize the replication connection on the source volume /// /// /// Authorize the replication connection on the source volume @@ -1145,12 +1055,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginAuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginAuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// ReInitialize volume replication + /// Re-Initializes the replication connection on the destination volume /// /// /// Re-Initializes the replication connection on the destination volume @@ -1176,12 +1084,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Change pool for volume + /// Moves volume to another pool /// /// /// Moves volume to another pool @@ -1210,12 +1116,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Relocate volume + /// Relocates volume to a new stamp /// /// /// Relocates volume to a new stamp @@ -1244,16 +1148,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Finalize volume relocation + /// Finalizes the relocation of the volume and cleans up the old volume. /// /// - /// Finalizes the relocation of the volume and cleans up the old - /// volume. + /// Finalizes the relocation of the volume and cleans up the old volume. /// /// /// The name of the resource group. The name is case insensitive. @@ -1276,16 +1177,13 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginFinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginFinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Revert volume relocation + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. /// /// - /// Reverts the volume relocation process, cleans up the new volume and - /// starts using the former-existing volume. + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. /// /// /// The name of the resource group. The name is case insensitive. @@ -1308,12 +1206,10 @@ public partial interface IVolumesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginRevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginRevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Describe all volumes + /// List all volumes within the capacity pool /// /// /// List all volumes within the capacity pool @@ -1333,9 +1229,7 @@ public partial interface IVolumesOperations /// /// 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)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountEncryption.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountEncryption.cs index 279a50ec462c..2f6d9791a3ea 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountEncryption.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountEncryption.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,24 @@ public AccountEncryption() /// /// Initializes a new instance of the AccountEncryption class. /// - /// The encryption keySource (provider). - /// Possible values (case-insensitive): Microsoft.NetApp, - /// Microsoft.KeyVault. Possible values include: 'Microsoft.NetApp', - /// 'Microsoft.KeyVault' - /// Properties provided by KeVault. - /// Applicable if keySource is 'Microsoft.KeyVault'. - /// Identity used to authenticate to KeyVault. - /// Applicable if keySource is 'Microsoft.KeyVault'. + + /// The encryption keySource (provider). Possible values (case-insensitive): + /// Microsoft.NetApp, Microsoft.KeyVault + /// Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' + + /// Properties provided by KeVault. Applicable if keySource is + /// 'Microsoft.KeyVault'. + /// + + /// Identity used to authenticate to KeyVault. Applicable if keySource is + /// 'Microsoft.KeyVault'. + /// public AccountEncryption(string keySource = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), EncryptionIdentity identity = default(EncryptionIdentity)) + { - KeySource = keySource; - KeyVaultProperties = keyVaultProperties; - Identity = identity; + this.KeySource = keySource; + this.KeyVaultProperties = keyVaultProperties; + this.Identity = identity; CustomInit(); } @@ -50,40 +49,41 @@ public AccountEncryption() /// partial void CustomInit(); + /// /// Gets or sets the encryption keySource (provider). Possible values - /// (case-insensitive): Microsoft.NetApp, Microsoft.KeyVault. Possible - /// values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' + /// (case-insensitive): Microsoft.NetApp, Microsoft.KeyVault Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' /// - [JsonProperty(PropertyName = "keySource")] - public string KeySource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keySource")] + public string KeySource {get; set; } /// - /// Gets or sets properties provided by KeVault. Applicable if - /// keySource is 'Microsoft.KeyVault'. + /// Gets or sets properties provided by KeVault. Applicable if keySource is + /// 'Microsoft.KeyVault'. /// - [JsonProperty(PropertyName = "keyVaultProperties")] - public KeyVaultProperties KeyVaultProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } /// - /// Gets or sets identity used to authenticate to KeyVault. Applicable - /// if keySource is 'Microsoft.KeyVault'. + /// Gets or sets identity used to authenticate to KeyVault. Applicable if + /// keySource is 'Microsoft.KeyVault'. /// - [JsonProperty(PropertyName = "identity")] - public EncryptionIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public EncryptionIdentity Identity {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (KeyVaultProperties != null) + + if (this.KeyVaultProperties != null) { - KeyVaultProperties.Validate(); + this.KeyVaultProperties.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountProperties.cs new file mode 100644 index 000000000000..9b901da6e6fa --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AccountProperties.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// NetApp account properties + /// + public partial class AccountProperties + { + /// + /// Initializes a new instance of the AccountProperties class. + /// + public AccountProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountProperties class. + /// + + /// Azure lifecycle management + /// + + /// Active Directories + /// + + /// Encryption settings + /// + + /// Shows the status of disableShowmount for all volumes under the + /// subscription, null equals false + /// + public AccountProperties(string provisioningState = default(string), System.Collections.Generic.IList activeDirectories = default(System.Collections.Generic.IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?)) + + { + this.ProvisioningState = provisioningState; + this.ActiveDirectories = activeDirectories; + this.Encryption = encryption; + this.DisableShowmount = disableShowmount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets active Directories + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "activeDirectories")] + public System.Collections.Generic.IList ActiveDirectories {get; set; } + + /// + /// Gets or sets encryption settings + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryption")] + public AccountEncryption Encryption {get; set; } + + /// + /// Gets shows the status of disableShowmount for all volumes under the + /// subscription, null equals false + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "disableShowmount")] + public bool? DisableShowmount {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.ActiveDirectories != null) + { + foreach (var element in this.ActiveDirectories) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.Encryption != null) + { + this.Encryption.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectory.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectory.cs index 6e4e699fac1e..dabc64b07dd0 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectory.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectory.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,87 +23,117 @@ public ActiveDirectory() /// /// Initializes a new instance of the ActiveDirectory class. /// - /// Id of the Active Directory - /// A domain user account with permission to - /// create machine accounts - /// Plain text password of Active Directory - /// domain administrator, value is masked in the response - /// Name of the Active Directory domain - /// Comma separated list of DNS server IP addresses - /// (IPv4 only) for the Active Directory domain - /// Status of the Active Directory. Possible - /// values include: 'Created', 'InUse', 'Deleted', 'Error', - /// 'Updating' - /// Any details in regards to the Status of - /// the Active Directory - /// NetBIOS name of the SMB server. This - /// name will be registered as a computer account in the AD and used to - /// mount volumes - /// The Organizational Unit (OU) - /// within the Windows Active Directory - /// The Active Directory site the service will limit - /// Domain Controller discovery to - /// Users to be added to the Built-in - /// Backup Operator active directory group. A list of unique usernames - /// without domain specifier - /// Users to be added to the Built-in - /// Administrators active directory group. A list of unique usernames - /// without domain specifier - /// kdc server IP addresses for the active - /// directory machine. This optional parameter is used only while - /// creating kerberos volume. - /// Name of the active directory machine. This - /// optional parameter is used only while creating kerberos - /// volume - /// When LDAP over SSL/TLS is - /// enabled, the LDAP client is required to have base64 encoded Active - /// Directory Certificate Service's self-signed root CA certificate, - /// this optional parameter is used only for dual protocol with LDAP - /// user-mapping volumes. - /// If enabled, AES encryption will be - /// enabled for SMB communication. - /// Specifies whether or not the LDAP traffic - /// needs to be signed. - /// Domain Users in the Active - /// directory to be given SeSecurityPrivilege privilege (Needed for SMB - /// Continuously available shares for SQL). A list of unique usernames - /// without domain specifier - /// Specifies whether or not the LDAP traffic - /// needs to be secured via TLS. - /// If enabled, NFS client - /// local users can also (in addition to LDAP users) access the NFS - /// volumes. - /// If enabled, Traffic between the - /// SMB server to Domain Controller (DC) will be encrypted. - /// LDAP Search scope options - /// Comma separated list of - /// IPv4 addresses of preferred servers for LDAP client. At most two - /// comma separated IPv4 addresses can be passed. - public ActiveDirectory(string activeDirectoryId = default(string), string username = default(string), string password = default(string), string domain = default(string), string dns = default(string), string status = default(string), string statusDetails = default(string), string smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), IList backupOperators = default(IList), IList administrators = default(IList), string kdcIP = default(string), string adName = default(string), string serverRootCACertificate = default(string), bool? aesEncryption = default(bool?), bool? ldapSigning = default(bool?), IList securityOperators = default(IList), bool? ldapOverTLS = default(bool?), bool? allowLocalNfsUsersWithLdap = default(bool?), bool? encryptDCConnections = default(bool?), LdapSearchScopeOpt ldapSearchScope = default(LdapSearchScopeOpt), string preferredServersForLdapClient = default(string)) + + /// Id of the Active Directory + /// + + /// A domain user account with permission to create machine accounts + /// + + /// Plain text password of Active Directory domain administrator, value is + /// masked in the response + /// + + /// Name of the Active Directory domain + /// + + /// Comma separated list of DNS server IP addresses (IPv4 only) for the Active + /// Directory domain + /// + + /// Status of the Active Directory + /// Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating' + + /// Any details in regards to the Status of the Active Directory + /// + + /// NetBIOS name of the SMB server. This name will be registered as a computer + /// account in the AD and used to mount volumes + /// + + /// The Organizational Unit (OU) within the Windows Active Directory + /// + + /// The Active Directory site the service will limit Domain Controller + /// discovery to + /// + + /// Users to be added to the Built-in Backup Operator active directory group. A + /// list of unique usernames without domain specifier + /// + + /// Users to be added to the Built-in Administrators active directory group. A + /// list of unique usernames without domain specifier + /// + + /// kdc server IP addresses for the active directory machine. This optional + /// parameter is used only while creating kerberos volume. + /// + + /// Name of the active directory machine. This optional parameter is used only + /// while creating kerberos volume + /// + + /// When LDAP over SSL/TLS is enabled, the LDAP client is required to have + /// base64 encoded Active Directory Certificate Service's self-signed root CA + /// certificate, this optional parameter is used only for dual protocol with + /// LDAP user-mapping volumes. + /// + + /// If enabled, AES encryption will be enabled for SMB communication. + /// + + /// Specifies whether or not the LDAP traffic needs to be signed. + /// + + /// Domain Users in the Active directory to be given SeSecurityPrivilege + /// privilege (Needed for SMB Continuously available shares for SQL). A list of + /// unique usernames without domain specifier + /// + + /// Specifies whether or not the LDAP traffic needs to be secured via TLS. + /// + + /// If enabled, NFS client local users can also (in addition to LDAP users) + /// access the NFS volumes. + /// + + /// If enabled, Traffic between the SMB server to Domain Controller (DC) will + /// be encrypted. + /// + + /// LDAP Search scope options + /// + + /// Comma separated list of IPv4 addresses of preferred servers for LDAP + /// client. At most two comma separated IPv4 addresses can be passed. + /// + public ActiveDirectory(string activeDirectoryId = default(string), string username = default(string), string password = default(string), string domain = default(string), string dns = default(string), string status = default(string), string statusDetails = default(string), string smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), System.Collections.Generic.IList backupOperators = default(System.Collections.Generic.IList), System.Collections.Generic.IList administrators = default(System.Collections.Generic.IList), string kdcIP = default(string), string adName = default(string), string serverRootCaCertificate = default(string), bool? aesEncryption = default(bool?), bool? ldapSigning = default(bool?), System.Collections.Generic.IList securityOperators = default(System.Collections.Generic.IList), bool? ldapOverTls = default(bool?), bool? allowLocalNfsUsersWithLdap = default(bool?), bool? encryptDcConnections = default(bool?), LdapSearchScopeOpt ldapSearchScope = default(LdapSearchScopeOpt), string preferredServersForLdapClient = default(string)) + { - ActiveDirectoryId = activeDirectoryId; - Username = username; - Password = password; - Domain = domain; - Dns = dns; - Status = status; - StatusDetails = statusDetails; - SmbServerName = smbServerName; - OrganizationalUnit = organizationalUnit; - Site = site; - BackupOperators = backupOperators; - Administrators = administrators; - KdcIP = kdcIP; - AdName = adName; - ServerRootCACertificate = serverRootCACertificate; - AesEncryption = aesEncryption; - LdapSigning = ldapSigning; - SecurityOperators = securityOperators; - LdapOverTLS = ldapOverTLS; - AllowLocalNfsUsersWithLdap = allowLocalNfsUsersWithLdap; - EncryptDCConnections = encryptDCConnections; - LdapSearchScope = ldapSearchScope; - PreferredServersForLdapClient = preferredServersForLdapClient; + this.ActiveDirectoryId = activeDirectoryId; + this.Username = username; + this.Password = password; + this.Domain = domain; + this.Dns = dns; + this.Status = status; + this.StatusDetails = statusDetails; + this.SmbServerName = smbServerName; + this.OrganizationalUnit = organizationalUnit; + this.Site = site; + this.BackupOperators = backupOperators; + this.Administrators = administrators; + this.KdcIP = kdcIP; + this.AdName = adName; + this.ServerRootCaCertificate = serverRootCaCertificate; + this.AesEncryption = aesEncryption; + this.LdapSigning = ldapSigning; + this.SecurityOperators = securityOperators; + this.LdapOverTls = ldapOverTls; + this.AllowLocalNfsUsersWithLdap = allowLocalNfsUsersWithLdap; + this.EncryptDcConnections = encryptDcConnections; + this.LdapSearchScope = ldapSearchScope; + this.PreferredServersForLdapClient = preferredServersForLdapClient; CustomInit(); } @@ -121,231 +142,235 @@ public ActiveDirectory() /// partial void CustomInit(); + /// /// Gets or sets id of the Active Directory /// - [JsonProperty(PropertyName = "activeDirectoryId")] - public string ActiveDirectoryId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "activeDirectoryId")] + public string ActiveDirectoryId {get; set; } /// - /// Gets or sets a domain user account with permission to create - /// machine accounts + /// Gets or sets a domain user account with permission to create machine + /// accounts /// - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "username")] + public string Username {get; set; } /// - /// Gets or sets plain text password of Active Directory domain - /// administrator, value is masked in the response + /// Gets or sets plain text password of Active Directory domain administrator, + /// value is masked in the response /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "password")] + public string Password {get; set; } /// /// Gets or sets name of the Active Directory domain /// - [JsonProperty(PropertyName = "domain")] - public string Domain { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "domain")] + public string Domain {get; set; } /// - /// Gets or sets comma separated list of DNS server IP addresses (IPv4 - /// only) for the Active Directory domain + /// Gets or sets comma separated list of DNS server IP addresses (IPv4 only) + /// for the Active Directory domain /// - [JsonProperty(PropertyName = "dns")] - public string Dns { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dns")] + public string Dns {get; set; } /// - /// Gets status of the Active Directory. Possible values include: - /// 'Created', 'InUse', 'Deleted', 'Error', 'Updating' + /// Gets status of the Active Directory Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; private set; } /// /// Gets any details in regards to the Status of the Active Directory /// - [JsonProperty(PropertyName = "statusDetails")] - public string StatusDetails { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "statusDetails")] + public string StatusDetails {get; private set; } /// - /// Gets or sets netBIOS name of the SMB server. This name will be - /// registered as a computer account in the AD and used to mount - /// volumes + /// Gets or sets netBIOS name of the SMB server. This name will be registered + /// as a computer account in the AD and used to mount volumes /// - [JsonProperty(PropertyName = "smbServerName")] - public string SmbServerName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "smbServerName")] + public string SmbServerName {get; set; } /// /// Gets or sets the Organizational Unit (OU) within the Windows Active /// Directory /// - [JsonProperty(PropertyName = "organizationalUnit")] - public string OrganizationalUnit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "organizationalUnit")] + public string OrganizationalUnit {get; set; } /// - /// Gets or sets the Active Directory site the service will limit - /// Domain Controller discovery to + /// Gets or sets the Active Directory site the service will limit Domain + /// Controller discovery to /// - [JsonProperty(PropertyName = "site")] - public string Site { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "site")] + public string Site {get; set; } /// - /// Gets or sets users to be added to the Built-in Backup Operator - /// active directory group. A list of unique usernames without domain - /// specifier + /// Gets or sets users to be added to the Built-in Backup Operator active + /// directory group. A list of unique usernames without domain specifier /// - [JsonProperty(PropertyName = "backupOperators")] - public IList BackupOperators { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backupOperators")] + public System.Collections.Generic.IList BackupOperators {get; set; } /// - /// Gets or sets users to be added to the Built-in Administrators - /// active directory group. A list of unique usernames without domain - /// specifier + /// Gets or sets users to be added to the Built-in Administrators active + /// directory group. A list of unique usernames without domain specifier /// - [JsonProperty(PropertyName = "administrators")] - public IList Administrators { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "administrators")] + public System.Collections.Generic.IList Administrators {get; set; } /// - /// Gets or sets kdc server IP addresses for the active directory - /// machine. This optional parameter is used only while creating - /// kerberos volume. + /// Gets or sets kdc server IP addresses for the active directory machine. This + /// optional parameter is used only while creating kerberos volume. /// - [JsonProperty(PropertyName = "kdcIP")] - public string KdcIP { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kdcIP")] + public string KdcIP {get; set; } /// - /// Gets or sets name of the active directory machine. This optional - /// parameter is used only while creating kerberos volume + /// Gets or sets name of the active directory machine. This optional parameter + /// is used only while creating kerberos volume /// - [JsonProperty(PropertyName = "adName")] - public string AdName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "adName")] + public string AdName {get; set; } /// - /// Gets or sets when LDAP over SSL/TLS is enabled, the LDAP client is - /// required to have base64 encoded Active Directory Certificate - /// Service's self-signed root CA certificate, this optional parameter - /// is used only for dual protocol with LDAP user-mapping volumes. + /// Gets or sets when LDAP over SSL/TLS is enabled, the LDAP client is required + /// to have base64 encoded Active Directory Certificate Service's self-signed + /// root CA certificate, this optional parameter is used only for dual protocol + /// with LDAP user-mapping volumes. /// - [JsonProperty(PropertyName = "serverRootCACertificate")] - public string ServerRootCACertificate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serverRootCACertificate")] + public string ServerRootCaCertificate {get; set; } /// /// Gets or sets if enabled, AES encryption will be enabled for SMB /// communication. /// - [JsonProperty(PropertyName = "aesEncryption")] - public bool? AesEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aesEncryption")] + public bool? AesEncryption {get; set; } /// - /// Gets or sets specifies whether or not the LDAP traffic needs to be - /// signed. + /// Gets or sets specifies whether or not the LDAP traffic needs to be signed. /// - [JsonProperty(PropertyName = "ldapSigning")] - public bool? LdapSigning { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ldapSigning")] + public bool? LdapSigning {get; set; } /// /// Gets or sets domain Users in the Active directory to be given - /// SeSecurityPrivilege privilege (Needed for SMB Continuously - /// available shares for SQL). A list of unique usernames without - /// domain specifier + /// SeSecurityPrivilege privilege (Needed for SMB Continuously available shares + /// for SQL). A list of unique usernames without domain specifier /// - [JsonProperty(PropertyName = "securityOperators")] - public IList SecurityOperators { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "securityOperators")] + public System.Collections.Generic.IList SecurityOperators {get; set; } /// - /// Gets or sets specifies whether or not the LDAP traffic needs to be - /// secured via TLS. + /// Gets or sets specifies whether or not the LDAP traffic needs to be secured + /// via TLS. /// - [JsonProperty(PropertyName = "ldapOverTLS")] - public bool? LdapOverTLS { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ldapOverTLS")] + public bool? LdapOverTls {get; set; } /// - /// Gets or sets If enabled, NFS client local users can also (in - /// addition to LDAP users) access the NFS volumes. + /// Gets or sets If enabled, NFS client local users can also (in addition to + /// LDAP users) access the NFS volumes. /// - [JsonProperty(PropertyName = "allowLocalNfsUsersWithLdap")] - public bool? AllowLocalNfsUsersWithLdap { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "allowLocalNfsUsersWithLdap")] + public bool? AllowLocalNfsUsersWithLdap {get; set; } /// /// Gets or sets if enabled, Traffic between the SMB server to Domain /// Controller (DC) will be encrypted. /// - [JsonProperty(PropertyName = "encryptDCConnections")] - public bool? EncryptDCConnections { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptDCConnections")] + public bool? EncryptDcConnections {get; set; } /// - /// Gets or sets LDAP Search scope options + /// Gets or sets lDAP Search scope options /// - [JsonProperty(PropertyName = "ldapSearchScope")] - public LdapSearchScopeOpt LdapSearchScope { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ldapSearchScope")] + public LdapSearchScopeOpt LdapSearchScope {get; set; } /// - /// Gets or sets comma separated list of IPv4 addresses of preferred - /// servers for LDAP client. At most two comma separated IPv4 addresses - /// can be passed. + /// Gets or sets comma separated list of IPv4 addresses of preferred servers + /// for LDAP client. At most two comma separated IPv4 addresses can be passed. /// - [JsonProperty(PropertyName = "preferredServersForLdapClient")] - public string PreferredServersForLdapClient { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "preferredServersForLdapClient")] + public string PreferredServersForLdapClient {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Dns != null) + + + + + if (this.Dns != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Dns, "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.Dns, "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$")) { - throw new ValidationException(ValidationRules.Pattern, "Dns", "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "Dns", "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$"); } } - if (KdcIP != null) + + + + + + + + if (this.KdcIP != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(KdcIP, "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.KdcIP, "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$")) { - throw new ValidationException(ValidationRules.Pattern, "KdcIP", "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "KdcIP", "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))*$"); } } - if (AdName != null) + if (this.AdName != null) { - if (AdName.Length > 64) + if (this.AdName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "AdName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "AdName", 64); } - if (AdName.Length < 1) + if (this.AdName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "AdName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "AdName", 1); } } - if (ServerRootCACertificate != null) + if (this.ServerRootCaCertificate != null) { - if (ServerRootCACertificate.Length > 10240) + if (this.ServerRootCaCertificate.Length > 10240) { - throw new ValidationException(ValidationRules.MaxLength, "ServerRootCACertificate", 10240); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "ServerRootCaCertificate", 10240); } - if (ServerRootCACertificate.Length < 1) + if (this.ServerRootCaCertificate.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "ServerRootCACertificate", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "ServerRootCaCertificate", 1); } } - if (LdapSearchScope != null) + + if (this.LdapSearchScope != null) { - LdapSearchScope.Validate(); + this.LdapSearchScope.Validate(); } - if (PreferredServersForLdapClient != null) + if (this.PreferredServersForLdapClient != null) { - if (PreferredServersForLdapClient.Length > 32) + if (this.PreferredServersForLdapClient.Length > 32) { - throw new ValidationException(ValidationRules.MaxLength, "PreferredServersForLdapClient", 32); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "PreferredServersForLdapClient", 32); } - if (!System.Text.RegularExpressions.Regex.IsMatch(PreferredServersForLdapClient, "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?)?$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.PreferredServersForLdapClient, "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?)?$")) { - throw new ValidationException(ValidationRules.Pattern, "PreferredServersForLdapClient", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?)?$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "PreferredServersForLdapClient", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)((, ?)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))?)?$"); } } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectoryStatus.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectoryStatus.cs index b02b3b60ac8b..85d795e8a86d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectoryStatus.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ActiveDirectoryStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for ActiveDirectoryStatus. /// + + public static class ActiveDirectoryStatus { /// @@ -37,4 +34,4 @@ public static class ActiveDirectoryStatus /// public const string Updating = "Updating"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ApplicationType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ApplicationType.cs index 5bf9d7370a50..0d236b336441 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ApplicationType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ApplicationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for ApplicationType. /// + + public static class ApplicationType { - public const string SAPHANA = "SAP-HANA"; + public const string SAPHana = "SAP-HANA"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AuthorizeRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AuthorizeRequest.cs index 0c9f13b8c69c..e7cf47d52ffb 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AuthorizeRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AuthorizeRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public AuthorizeRequest() /// /// Initializes a new instance of the AuthorizeRequest class. /// - /// Resource id of the remote - /// volume + + /// Resource id of the remote volume + /// public AuthorizeRequest(string remoteVolumeResourceId = default(string)) + { - RemoteVolumeResourceId = remoteVolumeResourceId; + this.RemoteVolumeResourceId = remoteVolumeResourceId; CustomInit(); } @@ -42,11 +38,11 @@ public AuthorizeRequest() /// partial void CustomInit(); + /// /// Gets or sets resource id of the remote volume /// - [JsonProperty(PropertyName = "remoteVolumeResourceId")] - public string RemoteVolumeResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVolumeResourceId")] + public string RemoteVolumeResourceId {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AvsDataStore.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AvsDataStore.cs index ef6800bb09ad..ef39c7a88f41 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AvsDataStore.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AvsDataStore.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for AvsDataStore. /// + + public static class AvsDataStore { /// @@ -25,4 +22,4 @@ public static class AvsDataStore /// public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AzureEntityResource.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AzureEntityResource.cs deleted file mode 100644 index a5d7fc63658b..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/AzureEntityResource.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Entity Resource - /// - /// - /// The resource model definition for an Azure Resource Manager resource - /// with an etag. - /// - public partial class AzureEntityResource : Resource - { - /// - /// Initializes a new instance of the AzureEntityResource class. - /// - public AzureEntityResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureEntityResource class. - /// - /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource Etag. - public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string)) - : base(id, name, type, systemData) - { - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Etag. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Backup.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Backup.cs index c86b77a4455e..3bf586e7d0af 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Backup.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Backup.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Backup of a Volume /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Backup : ProxyResource { /// @@ -32,39 +24,66 @@ public Backup() /// /// Initializes a new instance of the Backup class. /// - /// Resource location + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// backupId - /// creationDate - /// Azure lifecycle management - /// Size of backup - /// Label for backup - /// backupType - /// Failure reason - /// Volume name - /// Manual backup an already existing - /// snapshot. This will always be false for scheduled backups and - /// true/false for manual backups - public Backup(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) - : base(id, name, type, systemData) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource location + /// + + /// Type of backup Manual or Scheduled + /// Possible values include: 'Manual', 'Scheduled' + + /// UUID v4 used to identify the Backup + /// + + /// The creation date of the backup + /// + + /// Azure lifecycle management + /// + + /// Size of backup + /// + + /// Label for backup + /// + + /// Failure reason + /// + + /// Volume name + /// + + /// Manual backup an already existing snapshot. This will always be false for + /// scheduled backups and true/false for manual backups + /// + public Backup(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string backupType = default(string), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) + + : base(id, name, type, systemData) { - Location = location; - BackupId = backupId; - CreationDate = creationDate; - ProvisioningState = provisioningState; - Size = size; - Label = label; - BackupType = backupType; - FailureReason = failureReason; - VolumeName = volumeName; - UseExistingSnapshot = useExistingSnapshot; + this.Location = location; + this.BackupType = backupType; + this.BackupId = backupId; + this.CreationDate = creationDate; + this.ProvisioningState = provisioningState; + this.Size = size; + this.Label = label; + this.FailureReason = failureReason; + this.VolumeName = volumeName; + this.UseExistingSnapshot = useExistingSnapshot; CustomInit(); } @@ -73,105 +92,100 @@ public Backup() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets backupId + /// Gets type of backup Manual or Scheduled Possible values include: 'Manual', 'Scheduled' /// - /// - /// UUID v4 used to identify the Backup - /// - [JsonProperty(PropertyName = "properties.backupId")] - public string BackupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupType")] + public string BackupType {get; private set; } /// - /// Gets creationDate + /// Gets uUID v4 used to identify the Backup /// - /// - /// The creation date of the backup - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupId")] + public string BackupId {get; private set; } /// - /// Gets azure lifecycle management + /// Gets the creation date of the backup /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate {get; private set; } /// - /// Gets size of backup + /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.size")] - public long? Size { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets label for backup + /// Gets size of backup /// - [JsonProperty(PropertyName = "properties.label")] - public string Label { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long? Size {get; private set; } /// - /// Gets backupType + /// Gets or sets label for backup /// - /// - /// Type of backup Manual or Scheduled. Possible values include: - /// 'Manual', 'Scheduled' - /// - [JsonProperty(PropertyName = "properties.backupType")] - public string BackupType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.label")] + public string Label {get; set; } /// /// Gets failure reason /// - [JsonProperty(PropertyName = "properties.failureReason")] - public string FailureReason { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.failureReason")] + public string FailureReason {get; private set; } /// /// Gets volume name /// - [JsonProperty(PropertyName = "properties.volumeName")] - public string VolumeName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeName")] + public string VolumeName {get; private set; } /// - /// Gets or sets manual backup an already existing snapshot. This will - /// always be false for scheduled backups and true/false for manual - /// backups + /// Gets or sets manual backup an already existing snapshot. This will always + /// be false for scheduled backups and true/false for manual backups /// - [JsonProperty(PropertyName = "properties.useExistingSnapshot")] - public bool? UseExistingSnapshot { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useExistingSnapshot")] + public bool? UseExistingSnapshot {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } - if (BackupId != null) + + + if (this.BackupId != null) { - if (BackupId.Length > 36) + if (this.BackupId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "BackupId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "BackupId", 36); } - if (BackupId.Length < 36) + if (this.BackupId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "BackupId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "BackupId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPatch.cs index 363b9f892e3d..ff8fb88181db 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPatch.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Backup patch /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BackupPatch { /// @@ -34,30 +24,50 @@ public BackupPatch() /// /// Initializes a new instance of the BackupPatch class. /// - /// Resource tags - /// backupId - /// creationDate - /// Azure lifecycle management - /// Size of backup - /// Label for backup - /// backupType - /// Failure reason - /// Volume name - /// Manual backup an already existing - /// snapshot. This will always be false for scheduled backups and - /// true/false for manual backups - public BackupPatch(IDictionary tags = default(IDictionary), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) + + /// Resource tags + /// + + /// Type of backup Manual or Scheduled + /// Possible values include: 'Manual', 'Scheduled' + + /// UUID v4 used to identify the Backup + /// + + /// The creation date of the backup + /// + + /// Azure lifecycle management + /// + + /// Size of backup + /// + + /// Label for backup + /// + + /// Failure reason + /// + + /// Volume name + /// + + /// Manual backup an already existing snapshot. This will always be false for + /// scheduled backups and true/false for manual backups + /// + public BackupPatch(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string backupType = default(string), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) + { - Tags = tags; - BackupId = backupId; - CreationDate = creationDate; - ProvisioningState = provisioningState; - Size = size; - Label = label; - BackupType = backupType; - FailureReason = failureReason; - VolumeName = volumeName; - UseExistingSnapshot = useExistingSnapshot; + this.Tags = tags; + this.BackupType = backupType; + this.BackupId = backupId; + this.CreationDate = creationDate; + this.ProvisioningState = provisioningState; + this.Size = size; + this.Label = label; + this.FailureReason = failureReason; + this.VolumeName = volumeName; + this.UseExistingSnapshot = useExistingSnapshot; CustomInit(); } @@ -66,101 +76,96 @@ public BackupPatch() /// partial void CustomInit(); + /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets backupId + /// Gets type of backup Manual or Scheduled Possible values include: 'Manual', 'Scheduled' /// - /// - /// UUID v4 used to identify the Backup - /// - [JsonProperty(PropertyName = "properties.backupId")] - public string BackupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupType")] + public string BackupType {get; private set; } /// - /// Gets creationDate + /// Gets uUID v4 used to identify the Backup /// - /// - /// The creation date of the backup - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupId")] + public string BackupId {get; private set; } /// - /// Gets azure lifecycle management + /// Gets the creation date of the backup /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate {get; private set; } /// - /// Gets size of backup + /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.size")] - public long? Size { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets label for backup + /// Gets size of backup /// - [JsonProperty(PropertyName = "properties.label")] - public string Label { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long? Size {get; private set; } /// - /// Gets backupType + /// Gets or sets label for backup /// - /// - /// Type of backup Manual or Scheduled. Possible values include: - /// 'Manual', 'Scheduled' - /// - [JsonProperty(PropertyName = "properties.backupType")] - public string BackupType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.label")] + public string Label {get; set; } /// /// Gets failure reason /// - [JsonProperty(PropertyName = "properties.failureReason")] - public string FailureReason { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.failureReason")] + public string FailureReason {get; private set; } /// /// Gets volume name /// - [JsonProperty(PropertyName = "properties.volumeName")] - public string VolumeName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeName")] + public string VolumeName {get; private set; } /// - /// Gets or sets manual backup an already existing snapshot. This will - /// always be false for scheduled backups and true/false for manual - /// backups + /// Gets or sets manual backup an already existing snapshot. This will always + /// be false for scheduled backups and true/false for manual backups /// - [JsonProperty(PropertyName = "properties.useExistingSnapshot")] - public bool? UseExistingSnapshot { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.useExistingSnapshot")] + public bool? UseExistingSnapshot {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (BackupId != null) + + + if (this.BackupId != null) { - if (BackupId.Length > 36) + if (this.BackupId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "BackupId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "BackupId", 36); } - if (BackupId.Length < 36) + if (this.BackupId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "BackupId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "BackupId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicy.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicy.cs index 04ba468662f9..e00c7b421c48 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicy.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicy.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Backup policy information /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class BackupPolicy : TrackedResource { /// @@ -34,45 +24,67 @@ public BackupPolicy() /// /// Initializes a new instance of the BackupPolicy class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Backup Policy Resource ID - /// Azure lifecycle management - /// Daily backups count to - /// keep - /// Weekly backups count to - /// keep - /// Monthly backups count to - /// keep - /// Volumes using current backup - /// policy - /// The property to decide policy is enabled or - /// not - /// A list of volumes assigned to this - /// policy - public BackupPolicy(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList)) - : base(location, id, name, type, systemData, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Backup Policy Resource ID + /// + + /// Azure lifecycle management + /// + + /// Daily backups count to keep + /// + + /// Weekly backups count to keep + /// + + /// Monthly backups count to keep + /// + + /// Volumes using current backup policy + /// + + /// The property to decide policy is enabled or not + /// + + /// A list of volumes assigned to this policy + /// + public BackupPolicy(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), System.Collections.Generic.IList volumeBackups = default(System.Collections.Generic.IList)) + + : base(location, id, name, type, systemData, tags) { - Etag = etag; - BackupPolicyId = backupPolicyId; - ProvisioningState = provisioningState; - DailyBackupsToKeep = dailyBackupsToKeep; - WeeklyBackupsToKeep = weeklyBackupsToKeep; - MonthlyBackupsToKeep = monthlyBackupsToKeep; - VolumesAssigned = volumesAssigned; - Enabled = enabled; - VolumeBackups = volumeBackups; + this.Etag = etag; + this.BackupPolicyId = backupPolicyId; + this.ProvisioningState = provisioningState; + this.DailyBackupsToKeep = dailyBackupsToKeep; + this.WeeklyBackupsToKeep = weeklyBackupsToKeep; + this.MonthlyBackupsToKeep = monthlyBackupsToKeep; + this.VolumesAssigned = volumesAssigned; + this.Enabled = enabled; + this.VolumeBackups = volumeBackups; CustomInit(); } @@ -81,70 +93,74 @@ public BackupPolicy() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Gets backup Policy Resource ID /// - [JsonProperty(PropertyName = "properties.backupPolicyId")] - public string BackupPolicyId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupPolicyId")] + public string BackupPolicyId {get; private set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets daily backups count to keep /// - [JsonProperty(PropertyName = "properties.dailyBackupsToKeep")] - public int? DailyBackupsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailyBackupsToKeep")] + public int? DailyBackupsToKeep {get; set; } /// /// Gets or sets weekly backups count to keep /// - [JsonProperty(PropertyName = "properties.weeklyBackupsToKeep")] - public int? WeeklyBackupsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklyBackupsToKeep")] + public int? WeeklyBackupsToKeep {get; set; } /// /// Gets or sets monthly backups count to keep /// - [JsonProperty(PropertyName = "properties.monthlyBackupsToKeep")] - public int? MonthlyBackupsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monthlyBackupsToKeep")] + public int? MonthlyBackupsToKeep {get; set; } /// /// Gets volumes using current backup policy /// - [JsonProperty(PropertyName = "properties.volumesAssigned")] - public int? VolumesAssigned { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumesAssigned")] + public int? VolumesAssigned {get; private set; } /// /// Gets or sets the property to decide policy is enabled or not /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } /// /// Gets a list of volumes assigned to this policy /// - [JsonProperty(PropertyName = "properties.volumeBackups")] - public IList VolumeBackups { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeBackups")] + public System.Collections.Generic.IList VolumeBackups {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyPatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyPatch.cs index eb0fc1e95c4f..a82d87249e1d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyPatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyPatch.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Backup policy Details for create and update /// - [Rest.Serialization.JsonTransformation] - public partial class BackupPolicyPatch : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class BackupPolicyPatch : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the BackupPolicyPatch class. @@ -35,40 +24,61 @@ public BackupPolicyPatch() /// /// Initializes a new instance of the BackupPolicyPatch class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Backup Policy Resource ID - /// Azure lifecycle management - /// Daily backups count to - /// keep - /// Weekly backups count to - /// keep - /// Monthly backups count to - /// keep - /// Volumes using current backup - /// policy - /// The property to decide policy is enabled or - /// not - /// A list of volumes assigned to this - /// policy - public BackupPolicyPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// Backup Policy Resource ID + /// + + /// Azure lifecycle management + /// + + /// Daily backups count to keep + /// + + /// Weekly backups count to keep + /// + + /// Monthly backups count to keep + /// + + /// Volumes using current backup policy + /// + + /// The property to decide policy is enabled or not + /// + + /// A list of volumes assigned to this policy + /// + public BackupPolicyPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), System.Collections.Generic.IList volumeBackups = default(System.Collections.Generic.IList)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - BackupPolicyId = backupPolicyId; - ProvisioningState = provisioningState; - DailyBackupsToKeep = dailyBackupsToKeep; - WeeklyBackupsToKeep = weeklyBackupsToKeep; - MonthlyBackupsToKeep = monthlyBackupsToKeep; - VolumesAssigned = volumesAssigned; - Enabled = enabled; - VolumeBackups = volumeBackups; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.BackupPolicyId = backupPolicyId; + this.ProvisioningState = provisioningState; + this.DailyBackupsToKeep = dailyBackupsToKeep; + this.WeeklyBackupsToKeep = weeklyBackupsToKeep; + this.MonthlyBackupsToKeep = monthlyBackupsToKeep; + this.VolumesAssigned = volumesAssigned; + this.Enabled = enabled; + this.VolumeBackups = volumeBackups; CustomInit(); } @@ -77,83 +87,83 @@ public BackupPolicyPatch() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets backup Policy Resource ID /// - [JsonProperty(PropertyName = "properties.backupPolicyId")] - public string BackupPolicyId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupPolicyId")] + public string BackupPolicyId {get; private set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets daily backups count to keep /// - [JsonProperty(PropertyName = "properties.dailyBackupsToKeep")] - public int? DailyBackupsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailyBackupsToKeep")] + public int? DailyBackupsToKeep {get; set; } /// /// Gets or sets weekly backups count to keep /// - [JsonProperty(PropertyName = "properties.weeklyBackupsToKeep")] - public int? WeeklyBackupsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklyBackupsToKeep")] + public int? WeeklyBackupsToKeep {get; set; } /// /// Gets or sets monthly backups count to keep /// - [JsonProperty(PropertyName = "properties.monthlyBackupsToKeep")] - public int? MonthlyBackupsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monthlyBackupsToKeep")] + public int? MonthlyBackupsToKeep {get; set; } /// /// Gets volumes using current backup policy /// - [JsonProperty(PropertyName = "properties.volumesAssigned")] - public int? VolumesAssigned { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumesAssigned")] + public int? VolumesAssigned {get; private set; } /// /// Gets or sets the property to decide policy is enabled or not /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } /// /// Gets a list of volumes assigned to this policy /// - [JsonProperty(PropertyName = "properties.volumeBackups")] - public IList VolumeBackups { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeBackups")] + public System.Collections.Generic.IList VolumeBackups {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyProperties.cs new file mode 100644 index 000000000000..d6388404c2dd --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupPolicyProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Backup policy properties + /// + public partial class BackupPolicyProperties + { + /// + /// Initializes a new instance of the BackupPolicyProperties class. + /// + public BackupPolicyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupPolicyProperties class. + /// + + /// Backup Policy Resource ID + /// + + /// Azure lifecycle management + /// + + /// Daily backups count to keep + /// + + /// Weekly backups count to keep + /// + + /// Monthly backups count to keep + /// + + /// Volumes using current backup policy + /// + + /// The property to decide policy is enabled or not + /// + + /// A list of volumes assigned to this policy + /// + public BackupPolicyProperties(string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), System.Collections.Generic.IList volumeBackups = default(System.Collections.Generic.IList)) + + { + this.BackupPolicyId = backupPolicyId; + this.ProvisioningState = provisioningState; + this.DailyBackupsToKeep = dailyBackupsToKeep; + this.WeeklyBackupsToKeep = weeklyBackupsToKeep; + this.MonthlyBackupsToKeep = monthlyBackupsToKeep; + this.VolumesAssigned = volumesAssigned; + this.Enabled = enabled; + this.VolumeBackups = volumeBackups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets backup Policy Resource ID + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backupPolicyId")] + public string BackupPolicyId {get; private set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets daily backups count to keep + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dailyBackupsToKeep")] + public int? DailyBackupsToKeep {get; set; } + + /// + /// Gets or sets weekly backups count to keep + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "weeklyBackupsToKeep")] + public int? WeeklyBackupsToKeep {get; set; } + + /// + /// Gets or sets monthly backups count to keep + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "monthlyBackupsToKeep")] + public int? MonthlyBackupsToKeep {get; set; } + + /// + /// Gets volumes using current backup policy + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumesAssigned")] + public int? VolumesAssigned {get; private set; } + + /// + /// Gets or sets the property to decide policy is enabled or not + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } + + /// + /// Gets a list of volumes assigned to this policy + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeBackups")] + public System.Collections.Generic.IList VolumeBackups {get; private set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupProperties.cs new file mode 100644 index 000000000000..70a42ff917e0 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupProperties.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Backup properties + /// + public partial class BackupProperties + { + /// + /// Initializes a new instance of the BackupProperties class. + /// + public BackupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupProperties class. + /// + + /// UUID v4 used to identify the Backup + /// + + /// The creation date of the backup + /// + + /// Azure lifecycle management + /// + + /// Size of backup + /// + + /// Label for backup + /// + + /// Type of backup Manual or Scheduled + /// Possible values include: 'Manual', 'Scheduled' + + /// Failure reason + /// + + /// Volume name + /// + + /// Manual backup an already existing snapshot. This will always be false for + /// scheduled backups and true/false for manual backups + /// + public BackupProperties(string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) + + { + this.BackupId = backupId; + this.CreationDate = creationDate; + this.ProvisioningState = provisioningState; + this.Size = size; + this.Label = label; + this.BackupType = backupType; + this.FailureReason = failureReason; + this.VolumeName = volumeName; + this.UseExistingSnapshot = useExistingSnapshot; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets uUID v4 used to identify the Backup + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backupId")] + public string BackupId {get; private set; } + + /// + /// Gets the creation date of the backup + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationDate")] + public System.DateTime? CreationDate {get; private set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets size of backup + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public long? Size {get; private set; } + + /// + /// Gets or sets label for backup + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "label")] + public string Label {get; set; } + + /// + /// Gets type of backup Manual or Scheduled Possible values include: 'Manual', 'Scheduled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backupType")] + public string BackupType {get; private set; } + + /// + /// Gets failure reason + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "failureReason")] + public string FailureReason {get; private set; } + + /// + /// Gets volume name + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeName")] + public string VolumeName {get; private set; } + + /// + /// Gets or sets manual backup an already existing snapshot. This will always + /// be false for scheduled backups and true/false for manual backups + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "useExistingSnapshot")] + public bool? UseExistingSnapshot {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.BackupId != null) + { + if (this.BackupId.Length > 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "BackupId", 36); + } + if (this.BackupId.Length < 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "BackupId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(this.BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } + + + + + + } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupRestoreFiles.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupRestoreFiles.cs index 3bd768987778..46ddb85f0a9d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupRestoreFiles.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupRestoreFiles.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,18 +23,24 @@ public BackupRestoreFiles() /// /// Initializes a new instance of the BackupRestoreFiles class. /// - /// List of files to be restored - /// Resource Id of the destination - /// volume on which the files need to be restored - /// Destination folder where the files - /// will be restored. The path name should start with a forward slash. - /// If it is omitted from request then restore is done at the root - /// folder of the destination volume by default - public BackupRestoreFiles(IList fileList, string destinationVolumeId, string restoreFilePath = default(string)) + + /// List of files to be restored + /// + + /// Destination folder where the files will be restored. The path name should + /// start with a forward slash. If it is omitted from request then restore is + /// done at the root folder of the destination volume by default + /// + + /// Resource Id of the destination volume on which the files need to be + /// restored + /// + public BackupRestoreFiles(System.Collections.Generic.IList fileList, string destinationVolumeId, string restoreFilePath = default(string)) + { - FileList = fileList; - RestoreFilePath = restoreFilePath; - DestinationVolumeId = destinationVolumeId; + this.FileList = fileList; + this.RestoreFilePath = restoreFilePath; + this.DestinationVolumeId = destinationVolumeId; CustomInit(); } @@ -52,62 +49,62 @@ public BackupRestoreFiles() /// partial void CustomInit(); + /// /// Gets or sets list of files to be restored /// - [JsonProperty(PropertyName = "fileList")] - public IList FileList { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fileList")] + public System.Collections.Generic.IList FileList {get; set; } /// - /// Gets or sets destination folder where the files will be restored. - /// The path name should start with a forward slash. If it is omitted - /// from request then restore is done at the root folder of the - /// destination volume by default + /// Gets or sets destination folder where the files will be restored. The path + /// name should start with a forward slash. If it is omitted from request then + /// restore is done at the root folder of the destination volume by default /// - [JsonProperty(PropertyName = "restoreFilePath")] - public string RestoreFilePath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "restoreFilePath")] + public string RestoreFilePath {get; set; } /// - /// Gets or sets resource Id of the destination volume on which the - /// files need to be restored + /// Gets or sets resource Id of the destination volume on which the files need + /// to be restored /// - [JsonProperty(PropertyName = "destinationVolumeId")] - public string DestinationVolumeId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationVolumeId")] + public string DestinationVolumeId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (FileList == null) + if (this.FileList == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "FileList"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FileList"); } - if (DestinationVolumeId == null) + if (this.DestinationVolumeId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationVolumeId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DestinationVolumeId"); } - if (FileList != null) + if (this.FileList != null) { - if (FileList.Count > 8) + if (this.FileList.Count > 8) { - throw new ValidationException(ValidationRules.MaxItems, "FileList", 8); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "FileList", 8); } - if (FileList.Count < 1) + if (this.FileList.Count < 1) { - throw new ValidationException(ValidationRules.MinItems, "FileList", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinItems, "FileList", 1); } } - if (RestoreFilePath != null) + if (this.RestoreFilePath != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(RestoreFilePath, "^\\/.*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.RestoreFilePath, "^\\/.*$")) { - throw new ValidationException(ValidationRules.Pattern, "RestoreFilePath", "^\\/.*$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "RestoreFilePath", "^\\/.*$"); } } + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupStatus.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupStatus.cs index d8e3ad3027bc..ab86da4c1eac 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupStatus.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,32 +23,41 @@ public BackupStatus() /// /// Initializes a new instance of the BackupStatus class. /// - /// Backup health status - /// Status of the backup mirror - /// relationship. Possible values include: 'Idle', - /// 'Transferring' - /// The status of the backup. Possible values - /// include: 'Uninitialized', 'Mirrored', 'Broken' - /// Reason for the unhealthy backup - /// relationship - /// Displays error message if the backup is - /// in an error state - /// Displays the last transfer - /// size - /// Displays the last transfer - /// type - /// Displays the total bytes - /// transferred + + /// Backup health status + /// + + /// Status of the backup mirror relationship + /// Possible values include: 'Idle', 'Transferring' + + /// The status of the backup + /// Possible values include: 'Uninitialized', 'Mirrored', 'Broken' + + /// Reason for the unhealthy backup relationship + /// + + /// Displays error message if the backup is in an error state + /// + + /// Displays the last transfer size + /// + + /// Displays the last transfer type + /// + + /// Displays the total bytes transferred + /// public BackupStatus(bool? healthy = default(bool?), string relationshipStatus = default(string), string mirrorState = default(string), string unhealthyReason = default(string), string errorMessage = default(string), long? lastTransferSize = default(long?), string lastTransferType = default(string), long? totalTransferBytes = default(long?)) + { - Healthy = healthy; - RelationshipStatus = relationshipStatus; - MirrorState = mirrorState; - UnhealthyReason = unhealthyReason; - ErrorMessage = errorMessage; - LastTransferSize = lastTransferSize; - LastTransferType = lastTransferType; - TotalTransferBytes = totalTransferBytes; + this.Healthy = healthy; + this.RelationshipStatus = relationshipStatus; + this.MirrorState = mirrorState; + this.UnhealthyReason = unhealthyReason; + this.ErrorMessage = errorMessage; + this.LastTransferSize = lastTransferSize; + this.LastTransferType = lastTransferType; + this.TotalTransferBytes = totalTransferBytes; CustomInit(); } @@ -63,55 +66,53 @@ public BackupStatus() /// partial void CustomInit(); + /// /// Gets backup health status /// - [JsonProperty(PropertyName = "healthy")] - public bool? Healthy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "healthy")] + public bool? Healthy {get; private set; } /// - /// Gets status of the backup mirror relationship. Possible values - /// include: 'Idle', 'Transferring' + /// Gets status of the backup mirror relationship Possible values include: 'Idle', 'Transferring' /// - [JsonProperty(PropertyName = "relationshipStatus")] - public string RelationshipStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "relationshipStatus")] + public string RelationshipStatus {get; private set; } /// - /// Gets the status of the backup. Possible values include: - /// 'Uninitialized', 'Mirrored', 'Broken' + /// Gets the status of the backup Possible values include: 'Uninitialized', 'Mirrored', 'Broken' /// - [JsonProperty(PropertyName = "mirrorState")] - public string MirrorState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mirrorState")] + public string MirrorState {get; private set; } /// /// Gets reason for the unhealthy backup relationship /// - [JsonProperty(PropertyName = "unhealthyReason")] - public string UnhealthyReason { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unhealthyReason")] + public string UnhealthyReason {get; private set; } /// /// Gets displays error message if the backup is in an error state /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage {get; private set; } /// /// Gets displays the last transfer size /// - [JsonProperty(PropertyName = "lastTransferSize")] - public long? LastTransferSize { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastTransferSize")] + public long? LastTransferSize {get; private set; } /// /// Gets displays the last transfer type /// - [JsonProperty(PropertyName = "lastTransferType")] - public string LastTransferType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastTransferType")] + public string LastTransferType {get; private set; } /// /// Gets displays the total bytes transferred /// - [JsonProperty(PropertyName = "totalTransferBytes")] - public long? TotalTransferBytes { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "totalTransferBytes")] + public long? TotalTransferBytes {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupType.cs index 80f6c2483262..c7ff28ad8f3f 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for BackupType. /// + + public static class BackupType { /// @@ -25,4 +22,4 @@ public static class BackupType /// public const string Scheduled = "Scheduled"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupsRestoreFilesHeaders.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupsRestoreFilesHeaders.cs index de97f62da65d..66b2235141bf 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupsRestoreFilesHeaders.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BackupsRestoreFilesHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for RestoreFiles operation. - /// public partial class BackupsRestoreFilesHeaders { /// @@ -29,9 +20,13 @@ public BackupsRestoreFilesHeaders() /// /// Initializes a new instance of the BackupsRestoreFilesHeaders class. /// + + /// + /// public BackupsRestoreFilesHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -40,10 +35,11 @@ public BackupsRestoreFilesHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakFileLocksRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakFileLocksRequest.cs index 6b8b8b801083..a4d7b2f5dcf3 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakFileLocksRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakFileLocksRequest.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,15 +23,18 @@ public BreakFileLocksRequest() /// /// Initializes a new instance of the BreakFileLocksRequest class. /// - /// To clear file locks on a volume for a - /// particular client - /// Break File locks - /// could be a disruptive operation for application as locks on the - /// volume will be broken, if want to process, set to true. - public BreakFileLocksRequest(string clientIp = default(string), bool? confirmRunningDisruptiveOperation = default(bool?)) + + /// To clear file locks on a volume for a particular client + /// + + /// Break File locks could be a disruptive operation for application as locks + /// on the volume will be broken, if want to process, set to true. + /// + public BreakFileLocksRequest(string clientIP = default(string), bool? confirmRunningDisruptiveOperation = default(bool?)) + { - ClientIp = clientIp; - ConfirmRunningDisruptiveOperation = confirmRunningDisruptiveOperation; + this.ClientIP = clientIP; + this.ConfirmRunningDisruptiveOperation = confirmRunningDisruptiveOperation; CustomInit(); } @@ -47,36 +43,35 @@ public BreakFileLocksRequest() /// partial void CustomInit(); + /// - /// Gets or sets to clear file locks on a volume for a particular - /// client + /// Gets or sets to clear file locks on a volume for a particular client /// - [JsonProperty(PropertyName = "clientIp")] - public string ClientIp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "clientIp")] + public string ClientIP {get; set; } /// /// Gets or sets break File locks could be a disruptive operation for - /// application as locks on the volume will be broken, if want to - /// process, set to true. + /// application as locks on the volume will be broken, if want to process, set + /// to true. /// - [JsonProperty(PropertyName = "confirmRunningDisruptiveOperation")] - public bool? ConfirmRunningDisruptiveOperation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "confirmRunningDisruptiveOperation")] + public bool? ConfirmRunningDisruptiveOperation {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ClientIp != null) + if (this.ClientIP != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(ClientIp, "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.ClientIP, "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$")) { - throw new ValidationException(ValidationRules.Pattern, "ClientIp", "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "ClientIP", "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); } } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakReplicationRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakReplicationRequest.cs index 7da271e0c069..0e9ecb7554a3 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakReplicationRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/BreakReplicationRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,14 @@ public BreakReplicationRequest() /// /// Initializes a new instance of the BreakReplicationRequest class. /// - /// If replication is in status - /// transferring and you want to force break the replication, set to - /// true + + /// If replication is in status transferring and you want to force break the + /// replication, set to true + /// public BreakReplicationRequest(bool? forceBreakReplication = default(bool?)) + { - ForceBreakReplication = forceBreakReplication; + this.ForceBreakReplication = forceBreakReplication; CustomInit(); } @@ -43,12 +39,12 @@ public BreakReplicationRequest() /// partial void CustomInit(); + /// - /// Gets or sets if replication is in status transferring and you want - /// to force break the replication, set to true + /// Gets or sets if replication is in status transferring and you want to force + /// break the replication, set to true /// - [JsonProperty(PropertyName = "forceBreakReplication")] - public bool? ForceBreakReplication { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "forceBreakReplication")] + public bool? ForceBreakReplication {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPool.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPool.cs index 14a974a7b766..c0c99717c008 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPool.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPool.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Capacity pool resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class CapacityPool : TrackedResource { /// @@ -34,44 +24,74 @@ public CapacityPool() /// /// Initializes a new instance of the CapacityPool class. /// - /// The geo-location where the resource - /// lives - /// size - /// serviceLevel + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// poolId - /// Azure lifecycle management - /// Total throughput of pool in - /// MiB/s - /// Utilized throughput of pool - /// in MiB/s - /// qosType - /// If enabled (true) the pool can contain - /// cool Access enabled volumes. - /// encryptionType - public CapacityPool(string location, long size, string serviceLevel, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), string poolId = default(string), string provisioningState = default(string), double? totalThroughputMibps = default(double?), double? utilizedThroughputMibps = default(double?), string qosType = default(string), bool? coolAccess = default(bool?), string encryptionType = default(string)) - : base(location, id, name, type, systemData, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// The qos type of the pool + /// Possible values include: 'Auto', 'Manual' + + /// Encryption type of the capacity pool, set encryption type for data at rest + /// for this pool and all volumes in it. This value can only be set when + /// creating new pool. + /// Possible values include: 'Single', 'Double' + + /// UUID v4 used to identify the Pool + /// + + /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks + /// (value must be multiply of 4398046511104). + /// + + /// Azure lifecycle management + /// + + /// Total throughput of pool in MiB/s + /// + + /// Utilized throughput of pool in MiB/s + /// + + /// If enabled (true) the pool can contain cool Access enabled volumes. + /// + public CapacityPool(string location, string serviceLevel, long size, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), string qosType = default(string), string encryptionType = default(string), string poolId = default(string), string provisioningState = default(string), double? totalThroughputMibps = default(double?), double? utilizedThroughputMibps = default(double?), bool? coolAccess = default(bool?)) + + : base(location, id, name, type, systemData, tags) { - Etag = etag; - PoolId = poolId; - Size = size; - ServiceLevel = serviceLevel; - ProvisioningState = provisioningState; - TotalThroughputMibps = totalThroughputMibps; - UtilizedThroughputMibps = utilizedThroughputMibps; - QosType = qosType; - CoolAccess = coolAccess; - EncryptionType = encryptionType; + this.Etag = etag; + this.ServiceLevel = serviceLevel; + this.QosType = qosType; + this.EncryptionType = encryptionType; + this.PoolId = poolId; + this.Size = size; + this.ProvisioningState = provisioningState; + this.TotalThroughputMibps = totalThroughputMibps; + this.UtilizedThroughputMibps = utilizedThroughputMibps; + this.CoolAccess = coolAccess; CustomInit(); } @@ -80,116 +100,104 @@ public CapacityPool() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets poolId + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' /// - /// - /// UUID v4 used to identify the Pool - /// - [JsonProperty(PropertyName = "properties.poolId")] - public string PoolId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceLevel")] + public string ServiceLevel {get; set; } /// - /// Gets or sets size + /// Gets or sets the qos type of the pool Possible values include: 'Auto', 'Manual' /// - /// - /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB - /// chunks (value must be multiply of 4398046511104). - /// - [JsonProperty(PropertyName = "properties.size")] - public long Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.qosType")] + public string QosType {get; set; } /// - /// Gets or sets serviceLevel + /// Gets or sets encryption type of the capacity pool, set encryption type for + /// data at rest for this pool and all volumes in it. This value can only be + /// set when creating new pool. Possible values include: 'Single', 'Double' /// - /// - /// Possible values include: 'Standard', 'Premium', 'Ultra', - /// 'StandardZRS' - /// - [JsonProperty(PropertyName = "properties.serviceLevel")] - public string ServiceLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionType")] + public string EncryptionType {get; set; } /// - /// Gets azure lifecycle management + /// Gets uUID v4 used to identify the Pool /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.poolId")] + public string PoolId {get; private set; } /// - /// Gets total throughput of pool in MiB/s + /// Gets or sets provisioned size of the pool (in bytes). Allowed values are in + /// 1TiB chunks (value must be multiply of 4398046511104). /// - [JsonProperty(PropertyName = "properties.totalThroughputMibps")] - public double? TotalThroughputMibps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long Size {get; set; } /// - /// Gets utilized throughput of pool in MiB/s + /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.utilizedThroughputMibps")] - public double? UtilizedThroughputMibps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets qosType + /// Gets total throughput of pool in MiB/s /// - /// - /// The qos type of the pool. Possible values include: 'Auto', 'Manual' - /// - [JsonProperty(PropertyName = "properties.qosType")] - public string QosType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.totalThroughputMibps")] + public double? TotalThroughputMibps {get; private set; } /// - /// Gets or sets if enabled (true) the pool can contain cool Access - /// enabled volumes. + /// Gets utilized throughput of pool in MiB/s /// - [JsonProperty(PropertyName = "properties.coolAccess")] - public bool? CoolAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.utilizedThroughputMibps")] + public double? UtilizedThroughputMibps {get; private set; } /// - /// Gets or sets encryptionType + /// Gets or sets if enabled (true) the pool can contain cool Access enabled + /// volumes. /// - /// - /// Encryption type of the capacity pool, set encryption type for data - /// at rest for this pool and all volumes in it. This value can only be - /// set when creating new pool. Possible values include: 'Single', - /// 'Double' - /// - [JsonProperty(PropertyName = "properties.encryptionType")] - public string EncryptionType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (ServiceLevel == null) + if (this.ServiceLevel == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ServiceLevel"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ServiceLevel"); } - if (PoolId != null) + + + + + if (this.PoolId != null) { - if (PoolId.Length > 36) + if (this.PoolId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "PoolId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "PoolId", 36); } - if (PoolId.Length < 36) + if (this.PoolId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "PoolId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "PoolId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(PoolId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.PoolId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "PoolId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "PoolId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPoolPatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPoolPatch.cs index af24267a2893..1f96b7dc69f3 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPoolPatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CapacityPoolPatch.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Capacity pool patch resource /// - [Rest.Serialization.JsonTransformation] - public partial class CapacityPoolPatch : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class CapacityPoolPatch : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the CapacityPoolPatch class. @@ -35,25 +24,42 @@ public CapacityPoolPatch() /// /// Initializes a new instance of the CapacityPoolPatch class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// size - /// qosType - /// If enabled (true) the pool can contain - /// cool Access enabled volumes. - public CapacityPoolPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), long? size = default(long?), string qosType = default(string), bool? coolAccess = default(bool?)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// The qos type of the pool + /// Possible values include: 'Auto', 'Manual' + + /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks + /// (value must be multiply of 4398046511104). + /// + + /// If enabled (true) the pool can contain cool Access enabled volumes. + /// + public CapacityPoolPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string qosType = default(string), long? size = default(long?), bool? coolAccess = default(bool?)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - Size = size; - QosType = qosType; - CoolAccess = coolAccess; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.QosType = qosType; + this.Size = size; + this.CoolAccess = coolAccess; CustomInit(); } @@ -62,61 +68,55 @@ public CapacityPoolPatch() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets size + /// Gets or sets the qos type of the pool Possible values include: 'Auto', 'Manual' /// - /// - /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB - /// chunks (value must be multiply of 4398046511104). - /// - [JsonProperty(PropertyName = "properties.size")] - public long? Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.qosType")] + public string QosType {get; set; } /// - /// Gets or sets qosType + /// Gets or sets provisioned size of the pool (in bytes). Allowed values are in + /// 1TiB chunks (value must be multiply of 4398046511104). /// - /// - /// The qos type of the pool. Possible values include: 'Auto', 'Manual' - /// - [JsonProperty(PropertyName = "properties.qosType")] - public string QosType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long? Size {get; set; } /// - /// Gets or sets if enabled (true) the pool can contain cool Access - /// enabled volumes. + /// Gets or sets if enabled (true) the pool can contain cool Access enabled + /// volumes. /// - [JsonProperty(PropertyName = "properties.coolAccess")] - public bool? CoolAccess { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckAvailabilityResponse.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckAvailabilityResponse.cs index 3a9423f9e4a9..6b461f062a55 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckAvailabilityResponse.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckAvailabilityResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,24 +23,27 @@ public CheckAvailabilityResponse() /// /// Initializes a new instance of the CheckAvailabilityResponse class. /// - /// <code>true</code> indicates - /// name is valid and available. <code>false</code> - /// indicates the name is invalid, unavailable, or both. - /// <code>Invalid</code> indicates the - /// name provided does not match Azure App Service naming requirements. - /// <code>AlreadyExists</code> indicates that the name is - /// already in use and is therefore unavailable. Possible values - /// include: 'Invalid', 'AlreadyExists' - /// If reason == invalid, provide the user with - /// the reason why the given name is invalid, and provide the resource - /// naming requirements so that the user can select a valid name. If - /// reason == AlreadyExists, explain that resource name is already in - /// use, and direct them to select a different name. + + /// <code>true</code> indicates name is valid and available. <code>false</code> + /// indicates the name is invalid, unavailable, or both. + /// + + /// <code>Invalid</code> indicates the name provided does not match Azure App + /// Service naming requirements. <code>AlreadyExists</code> indicates that the + /// name is already in use and is therefore unavailable. + /// Possible values include: 'Invalid', 'AlreadyExists' + + /// If reason == invalid, provide the user with the reason why the given name + /// is invalid, and provide the resource naming requirements so that the user + /// can select a valid name. If reason == AlreadyExists, explain that resource + /// name is already in use, and direct them to select a different name. + /// public CheckAvailabilityResponse(bool? isAvailable = default(bool?), string reason = default(string), string message = default(string)) + { - IsAvailable = isAvailable; - Reason = reason; - Message = message; + this.IsAvailable = isAvailable; + this.Reason = reason; + this.Message = message; CustomInit(); } @@ -55,35 +52,30 @@ public CheckAvailabilityResponse() /// partial void CustomInit(); + /// - /// Gets or sets &lt;code&gt;true&lt;/code&gt; - /// indicates name is valid and available. - /// &lt;code&gt;false&lt;/code&gt; indicates the name - /// is invalid, unavailable, or both. + /// Gets or sets <code>true</code> indicates name is valid and available. + /// <code>false</code> indicates the name is invalid, unavailable, or both. /// - [JsonProperty(PropertyName = "isAvailable")] - public bool? IsAvailable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isAvailable")] + public bool? IsAvailable {get; set; } /// - /// Gets or sets &lt;code&gt;Invalid&lt;/code&gt; - /// indicates the name provided does not match Azure App Service naming - /// requirements. - /// &lt;code&gt;AlreadyExists&lt;/code&gt; indicates - /// that the name is already in use and is therefore unavailable. - /// Possible values include: 'Invalid', 'AlreadyExists' + /// Gets or sets <code>Invalid</code> indicates the name provided does not + /// match Azure App Service naming requirements. <code>AlreadyExists</code> + /// indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists' /// - [JsonProperty(PropertyName = "reason")] - public string Reason { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "reason")] + public string Reason {get; set; } /// - /// Gets or sets if reason == invalid, provide the user with the reason - /// why the given name is invalid, and provide the resource naming - /// requirements so that the user can select a valid name. If reason == - /// AlreadyExists, explain that resource name is already in use, and - /// direct them to select a different name. + /// Gets or sets if reason == invalid, provide the user with the reason why the + /// given name is invalid, and provide the resource naming requirements so that + /// the user can select a valid name. If reason == AlreadyExists, explain that + /// resource name is already in use, and direct them to select a different + /// name. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckNameResourceTypes.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckNameResourceTypes.cs index 01e93eadf107..5c43663721be 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckNameResourceTypes.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckNameResourceTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for CheckNameResourceTypes. /// + + public static class CheckNameResourceTypes { public const string MicrosoftNetAppNetAppAccounts = "Microsoft.NetApp/netAppAccounts"; @@ -21,4 +18,4 @@ public static class CheckNameResourceTypes public const string MicrosoftNetAppNetAppAccountsCapacityPoolsVolumes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"; public const string MicrosoftNetAppNetAppAccountsCapacityPoolsVolumesSnapshots = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckQuotaNameResourceTypes.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckQuotaNameResourceTypes.cs index ceb19e6c5559..e927f3849256 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckQuotaNameResourceTypes.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CheckQuotaNameResourceTypes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for CheckQuotaNameResourceTypes. /// + + public static class CheckQuotaNameResourceTypes { public const string MicrosoftNetAppNetAppAccounts = "Microsoft.NetApp/netAppAccounts"; @@ -21,4 +18,4 @@ public static class CheckQuotaNameResourceTypes public const string MicrosoftNetAppNetAppAccountsCapacityPoolsVolumes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"; public const string MicrosoftNetAppNetAppAccountsCapacityPoolsVolumesSnapshots = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ChownMode.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ChownMode.cs index 8042ee631d9c..ab63d884577d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ChownMode.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ChownMode.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for ChownMode. /// + + public static class ChownMode { public const string Restricted = "Restricted"; public const string Unrestricted = "Unrestricted"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CreatedByType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CreatedByType.cs index 310b432cb7f3..a8747ef2bd73 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CreatedByType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/CreatedByType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for CreatedByType. /// + + public static class CreatedByType { public const string User = "User"; @@ -21,4 +18,4 @@ public static class CreatedByType public const string ManagedIdentity = "ManagedIdentity"; public const string Key = "Key"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/DailySchedule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/DailySchedule.cs index 741527852a0a..b87460bd04b8 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/DailySchedule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/DailySchedule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,25 @@ public DailySchedule() /// /// Initializes a new instance of the DailySchedule class. /// - /// Daily snapshot count to keep - /// Indicates which hour in UTC timezone a snapshot - /// should be taken - /// Indicates which minute snapshot should be - /// taken - /// Resource size in bytes, current storage - /// usage for the volume in bytes + + /// Daily snapshot count to keep + /// + + /// Indicates which hour in UTC timezone a snapshot should be taken + /// + + /// Indicates which minute snapshot should be taken + /// + + /// Resource size in bytes, current storage usage for the volume in bytes + /// public DailySchedule(int? snapshotsToKeep = default(int?), int? hour = default(int?), int? minute = default(int?), long? usedBytes = default(long?)) + { - SnapshotsToKeep = snapshotsToKeep; - Hour = hour; - Minute = minute; - UsedBytes = usedBytes; + this.SnapshotsToKeep = snapshotsToKeep; + this.Hour = hour; + this.Minute = minute; + this.UsedBytes = usedBytes; CustomInit(); } @@ -50,31 +50,31 @@ public DailySchedule() /// partial void CustomInit(); + /// /// Gets or sets daily snapshot count to keep /// - [JsonProperty(PropertyName = "snapshotsToKeep")] - public int? SnapshotsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotsToKeep")] + public int? SnapshotsToKeep {get; set; } /// - /// Gets or sets indicates which hour in UTC timezone a snapshot should - /// be taken + /// Gets or sets indicates which hour in UTC timezone a snapshot should be + /// taken /// - [JsonProperty(PropertyName = "hour")] - public int? Hour { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hour")] + public int? Hour {get; set; } /// /// Gets or sets indicates which minute snapshot should be taken /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minute")] + public int? Minute {get; set; } /// - /// Gets or sets resource size in bytes, current storage usage for the - /// volume in bytes + /// Gets or sets resource size in bytes, current storage usage for the volume + /// in bytes /// - [JsonProperty(PropertyName = "usedBytes")] - public long? UsedBytes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "usedBytes")] + public long? UsedBytes {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Dimension.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Dimension.cs index caeaeea6098b..30a58b1e5064 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Dimension.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Dimension.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public Dimension() /// /// Initializes a new instance of the Dimension class. /// - /// Display name of dimension. - /// Display name of dimension. + + /// Display name of dimension. + /// + + /// Display name of dimension. + /// public Dimension(string name = default(string), string displayName = default(string)) + { - Name = name; - DisplayName = displayName; + this.Name = name; + this.DisplayName = displayName; CustomInit(); } @@ -43,17 +42,17 @@ public Dimension() /// partial void CustomInit(); + /// /// Gets or sets display name of dimension. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets display name of dimension. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EnableSubvolumes.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EnableSubvolumes.cs index 02409626c287..ec25c1b7bba7 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EnableSubvolumes.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EnableSubvolumes.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for EnableSubvolumes. /// + + public static class EnableSubvolumes { /// @@ -25,4 +22,4 @@ public static class EnableSubvolumes /// public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionIdentity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionIdentity.cs index 14cec3f3db4e..d06871fe1316 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionIdentity.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionIdentity.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,20 @@ public EncryptionIdentity() /// /// Initializes a new instance of the EncryptionIdentity class. /// - /// The principal ID (object ID) of the - /// identity used to authenticate with key vault. Read-only. - /// The ARM resource identifier of - /// the user assigned identity used to authenticate with key vault. - /// Applicable if identity.type has 'UserAssigned'. It should match key - /// of identity.userAssignedIdentities. + + /// The principal ID (object ID) of the identity used to authenticate with key + /// vault. Read-only. + /// + + /// The ARM resource identifier of the user assigned identity used to + /// authenticate with key vault. Applicable if identity.type has + /// 'UserAssigned'. It should match key of identity.userAssignedIdentities. + /// public EncryptionIdentity(string principalId = default(string), string userAssignedIdentity = default(string)) + { - PrincipalId = principalId; - UserAssignedIdentity = userAssignedIdentity; + this.PrincipalId = principalId; + this.UserAssignedIdentity = userAssignedIdentity; CustomInit(); } @@ -47,21 +45,20 @@ public EncryptionIdentity() /// partial void CustomInit(); + /// - /// Gets the principal ID (object ID) of the identity used to - /// authenticate with key vault. Read-only. + /// Gets the principal ID (object ID) of the identity used to authenticate with + /// key vault. Read-only. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// - /// Gets or sets the ARM resource identifier of the user assigned - /// identity used to authenticate with key vault. Applicable if - /// identity.type has 'UserAssigned'. It should match key of - /// identity.userAssignedIdentities. + /// Gets or sets the ARM resource identifier of the user assigned identity used + /// to authenticate with key vault. Applicable if identity.type has + /// 'UserAssigned'. It should match key of identity.userAssignedIdentities. /// - [JsonProperty(PropertyName = "userAssignedIdentity")] - public string UserAssignedIdentity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionKeySource.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionKeySource.cs index c34f7a337d6c..e34152c5772d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionKeySource.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionKeySource.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for EncryptionKeySource. /// + + public static class EncryptionKeySource { /// @@ -25,4 +22,4 @@ public static class EncryptionKeySource /// public const string MicrosoftKeyVault = "Microsoft.KeyVault"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionType.cs index ff4d29dfe516..54b24246395f 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EncryptionType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for EncryptionType. /// + + public static class EncryptionType { /// @@ -25,4 +22,4 @@ public static class EncryptionType /// public const string Double = "Double"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EndpointType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EndpointType.cs index 41a23064e182..91b46bb1eae5 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EndpointType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/EndpointType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for EndpointType. /// + + public static class EndpointType { public const string Src = "src"; public const string Dst = "dst"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs index ae69eec97d03..cb3fe4ea3aa8 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ErrorAdditionalInfo() /// /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// The additional info type. - /// The additional info. + + /// The additional info type. + /// + + /// The additional info. + /// public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { - Type = type; - Info = info; + this.Type = type; + this.Info = info; CustomInit(); } @@ -43,17 +42,17 @@ public ErrorAdditionalInfo() /// partial void CustomInit(); + /// /// Gets the additional info type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the additional info. /// - [JsonProperty(PropertyName = "info")] - public object Info { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "info")] + public object Info {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorDetail.cs index 1c787783babe..ffaa0bb5ab36 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorDetail.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,29 @@ public ErrorDetail() /// /// Initializes a new instance of the ErrorDetail class. /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; CustomInit(); } @@ -51,35 +54,35 @@ public ErrorDetail() /// partial void CustomInit(); + /// /// Gets the error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } /// /// Gets the error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } /// /// Gets the error target. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } /// /// Gets the error details. /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } /// /// Gets the error additional info. /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponse.cs index 32ba6243a1b8..6a6579b6faf6 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -1,25 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Error response + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// /// - /// Common error response for all Azure Resource Manager APIs to return - /// error details for failed operations. (This also follows the OData error - /// response format.). + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// public partial class ErrorResponse { @@ -34,10 +30,13 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error object. + + /// The error object. + /// public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -46,11 +45,11 @@ public ErrorResponse() /// partial void CustomInit(); + /// /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponseException.cs index fa15ab5adc19..96fec41e21be 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ExportPolicyRule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ExportPolicyRule.cs index d7d96bb570fd..743c46b91c66 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ExportPolicyRule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ExportPolicyRule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,52 +23,78 @@ public ExportPolicyRule() /// /// Initializes a new instance of the ExportPolicyRule class. /// - /// Order index - /// Read only access - /// Read and write access - /// Kerberos5 Read only access. To be - /// use with swagger version 2020-05-01 or later - /// Kerberos5 Read and write access. - /// To be use with swagger version 2020-05-01 or later - /// Kerberos5i Read only access. To be - /// use with swagger version 2020-05-01 or later - /// Kerberos5i Read and write access. - /// To be use with swagger version 2020-05-01 or later - /// Kerberos5p Read only access. To be - /// use with swagger version 2020-05-01 or later - /// Kerberos5p Read and write access. - /// To be use with swagger version 2020-05-01 or later - /// Allows CIFS protocol - /// Allows NFSv3 protocol. Enable only for NFSv3 - /// type volumes - /// Allows NFSv4.1 protocol. Enable only for - /// NFSv4.1 type volumes - /// Client ingress specification as comma - /// separated string with IPv4 CIDRs, IPv4 host addresses and host - /// names - /// Has root access to volume - /// This parameter specifies who is authorized - /// to change the ownership of a file. restricted - Only root user can - /// change the ownership of the file. unrestricted - Non-root users can - /// change ownership of files that they own. Possible values include: - /// 'Restricted', 'Unrestricted' - public ExportPolicyRule(int? ruleIndex = default(int?), bool? unixReadOnly = default(bool?), bool? unixReadWrite = default(bool?), bool? kerberos5ReadOnly = default(bool?), bool? kerberos5ReadWrite = default(bool?), bool? kerberos5iReadOnly = default(bool?), bool? kerberos5iReadWrite = default(bool?), bool? kerberos5pReadOnly = default(bool?), bool? kerberos5pReadWrite = default(bool?), bool? cifs = default(bool?), bool? nfsv3 = default(bool?), bool? nfsv41 = default(bool?), string allowedClients = default(string), bool? hasRootAccess = default(bool?), string chownMode = default(string)) + + /// Order index + /// + + /// Read only access + /// + + /// Read and write access + /// + + /// Kerberos5 Read only access. To be use with swagger version 2020-05-01 or + /// later + /// + + /// Kerberos5 Read and write access. To be use with swagger version 2020-05-01 + /// or later + /// + + /// Kerberos5i Read only access. To be use with swagger version 2020-05-01 or + /// later + /// + + /// Kerberos5i Read and write access. To be use with swagger version 2020-05-01 + /// or later + /// + + /// Kerberos5p Read only access. To be use with swagger version 2020-05-01 or + /// later + /// + + /// Kerberos5p Read and write access. To be use with swagger version 2020-05-01 + /// or later + /// + + /// Allows CIFS protocol + /// + + /// Allows NFSv3 protocol. Enable only for NFSv3 type volumes + /// + + /// Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes + /// + + /// Client ingress specification as comma separated string with IPv4 CIDRs, + /// IPv4 host addresses and host names + /// + + /// Has root access to volume + /// + + /// This parameter specifies who is authorized to change the ownership of a + /// file. restricted - Only root user can change the ownership of the file. + /// unrestricted - Non-root users can change ownership of files that they own. + /// Possible values include: 'Restricted', 'Unrestricted' + public ExportPolicyRule(int? ruleIndex = default(int?), bool? unixReadOnly = default(bool?), bool? unixReadWrite = default(bool?), bool? kerberos5ReadOnly = default(bool?), bool? kerberos5ReadWrite = default(bool?), bool? kerberos5IReadOnly = default(bool?), bool? kerberos5IReadWrite = default(bool?), bool? kerberos5PReadOnly = default(bool?), bool? kerberos5PReadWrite = default(bool?), bool? cifs = default(bool?), bool? nfsv3 = default(bool?), bool? nfsv41 = default(bool?), string allowedClients = default(string), bool? hasRootAccess = default(bool?), string chownMode = default(string)) + { - RuleIndex = ruleIndex; - UnixReadOnly = unixReadOnly; - UnixReadWrite = unixReadWrite; - Kerberos5ReadOnly = kerberos5ReadOnly; - Kerberos5ReadWrite = kerberos5ReadWrite; - Kerberos5iReadOnly = kerberos5iReadOnly; - Kerberos5iReadWrite = kerberos5iReadWrite; - Kerberos5pReadOnly = kerberos5pReadOnly; - Kerberos5pReadWrite = kerberos5pReadWrite; - Cifs = cifs; - Nfsv3 = nfsv3; - Nfsv41 = nfsv41; - AllowedClients = allowedClients; - HasRootAccess = hasRootAccess; - ChownMode = chownMode; + this.RuleIndex = ruleIndex; + this.UnixReadOnly = unixReadOnly; + this.UnixReadWrite = unixReadWrite; + this.Kerberos5ReadOnly = kerberos5ReadOnly; + this.Kerberos5ReadWrite = kerberos5ReadWrite; + this.Kerberos5IReadOnly = kerberos5IReadOnly; + this.Kerberos5IReadWrite = kerberos5IReadWrite; + this.Kerberos5PReadOnly = kerberos5PReadOnly; + this.Kerberos5PReadWrite = kerberos5PReadWrite; + this.Cifs = cifs; + this.Nfsv3 = nfsv3; + this.Nfsv41 = nfsv41; + this.AllowedClients = allowedClients; + this.HasRootAccess = hasRootAccess; + this.ChownMode = chownMode; CustomInit(); } @@ -83,108 +103,105 @@ public ExportPolicyRule() /// partial void CustomInit(); + /// /// Gets or sets order index /// - [JsonProperty(PropertyName = "ruleIndex")] - public int? RuleIndex { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleIndex")] + public int? RuleIndex {get; set; } /// /// Gets or sets read only access /// - [JsonProperty(PropertyName = "unixReadOnly")] - public bool? UnixReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unixReadOnly")] + public bool? UnixReadOnly {get; set; } /// /// Gets or sets read and write access /// - [JsonProperty(PropertyName = "unixReadWrite")] - public bool? UnixReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unixReadWrite")] + public bool? UnixReadWrite {get; set; } /// - /// Gets or sets kerberos5 Read only access. To be use with swagger - /// version 2020-05-01 or later + /// Gets or sets kerberos5 Read only access. To be use with swagger version + /// 2020-05-01 or later /// - [JsonProperty(PropertyName = "kerberos5ReadOnly")] - public bool? Kerberos5ReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberos5ReadOnly")] + public bool? Kerberos5ReadOnly {get; set; } /// - /// Gets or sets kerberos5 Read and write access. To be use with - /// swagger version 2020-05-01 or later + /// Gets or sets kerberos5 Read and write access. To be use with swagger + /// version 2020-05-01 or later /// - [JsonProperty(PropertyName = "kerberos5ReadWrite")] - public bool? Kerberos5ReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberos5ReadWrite")] + public bool? Kerberos5ReadWrite {get; set; } /// - /// Gets or sets kerberos5i Read only access. To be use with swagger - /// version 2020-05-01 or later + /// Gets or sets kerberos5i Read only access. To be use with swagger version + /// 2020-05-01 or later /// - [JsonProperty(PropertyName = "kerberos5iReadOnly")] - public bool? Kerberos5iReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberos5iReadOnly")] + public bool? Kerberos5IReadOnly {get; set; } /// - /// Gets or sets kerberos5i Read and write access. To be use with - /// swagger version 2020-05-01 or later + /// Gets or sets kerberos5i Read and write access. To be use with swagger + /// version 2020-05-01 or later /// - [JsonProperty(PropertyName = "kerberos5iReadWrite")] - public bool? Kerberos5iReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberos5iReadWrite")] + public bool? Kerberos5IReadWrite {get; set; } /// - /// Gets or sets kerberos5p Read only access. To be use with swagger - /// version 2020-05-01 or later + /// Gets or sets kerberos5p Read only access. To be use with swagger version + /// 2020-05-01 or later /// - [JsonProperty(PropertyName = "kerberos5pReadOnly")] - public bool? Kerberos5pReadOnly { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberos5pReadOnly")] + public bool? Kerberos5PReadOnly {get; set; } /// - /// Gets or sets kerberos5p Read and write access. To be use with - /// swagger version 2020-05-01 or later + /// Gets or sets kerberos5p Read and write access. To be use with swagger + /// version 2020-05-01 or later /// - [JsonProperty(PropertyName = "kerberos5pReadWrite")] - public bool? Kerberos5pReadWrite { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberos5pReadWrite")] + public bool? Kerberos5PReadWrite {get; set; } /// /// Gets or sets allows CIFS protocol /// - [JsonProperty(PropertyName = "cifs")] - public bool? Cifs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "cifs")] + public bool? Cifs {get; set; } /// - /// Gets or sets allows NFSv3 protocol. Enable only for NFSv3 type - /// volumes + /// Gets or sets allows NFSv3 protocol. Enable only for NFSv3 type volumes /// - [JsonProperty(PropertyName = "nfsv3")] - public bool? Nfsv3 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nfsv3")] + public bool? Nfsv3 {get; set; } /// - /// Gets or sets allows NFSv4.1 protocol. Enable only for NFSv4.1 type - /// volumes + /// Gets or sets allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes /// - [JsonProperty(PropertyName = "nfsv41")] - public bool? Nfsv41 { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nfsv41")] + public bool? Nfsv41 {get; set; } /// - /// Gets or sets client ingress specification as comma separated string - /// with IPv4 CIDRs, IPv4 host addresses and host names + /// Gets or sets client ingress specification as comma separated string with + /// IPv4 CIDRs, IPv4 host addresses and host names /// - [JsonProperty(PropertyName = "allowedClients")] - public string AllowedClients { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "allowedClients")] + public string AllowedClients {get; set; } /// /// Gets or sets has root access to volume /// - [JsonProperty(PropertyName = "hasRootAccess")] - public bool? HasRootAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hasRootAccess")] + public bool? HasRootAccess {get; set; } /// - /// Gets or sets this parameter specifies who is authorized to change - /// the ownership of a file. restricted - Only root user can change the - /// ownership of the file. unrestricted - Non-root users can change - /// ownership of files that they own. Possible values include: - /// 'Restricted', 'Unrestricted' + /// Gets or sets this parameter specifies who is authorized to change the + /// ownership of a file. restricted - Only root user can change the ownership + /// of the file. unrestricted - Non-root users can change ownership of files + /// that they own. Possible values include: 'Restricted', 'Unrestricted' /// - [JsonProperty(PropertyName = "chownMode")] - public string ChownMode { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "chownMode")] + public string ChownMode {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FileAccessLogs.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FileAccessLogs.cs index e35e3f17a482..d465eddf1082 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FileAccessLogs.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FileAccessLogs.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for FileAccessLogs. /// + + public static class FileAccessLogs { /// @@ -25,4 +22,4 @@ public static class FileAccessLogs /// public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FilePathAvailabilityRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FilePathAvailabilityRequest.cs index bee29e41394e..dc5dd66486b5 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FilePathAvailabilityRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/FilePathAvailabilityRequest.cs @@ -1,28 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// File path availability request content - availability is based on the - /// name and the subnetId. + /// File path availability request content - availability is based on the name + /// and the subnetId. /// public partial class FilePathAvailabilityRequest { /// - /// Initializes a new instance of the FilePathAvailabilityRequest - /// class. + /// Initializes a new instance of the FilePathAvailabilityRequest class. /// public FilePathAvailabilityRequest() { @@ -30,16 +22,20 @@ public FilePathAvailabilityRequest() } /// - /// Initializes a new instance of the FilePathAvailabilityRequest - /// class. + /// Initializes a new instance of the FilePathAvailabilityRequest class. /// - /// File path to verify. - /// The Azure Resource URI for a delegated - /// subnet. Must have the delegation Microsoft.NetApp/volumes + + /// File path to verify. + /// + + /// The Azure Resource URI for a delegated subnet. Must have the delegation + /// Microsoft.NetApp/volumes + /// public FilePathAvailabilityRequest(string name, string subnetId) + { - Name = name; - SubnetId = subnetId; + this.Name = name; + this.SubnetId = subnetId; CustomInit(); } @@ -48,35 +44,37 @@ public FilePathAvailabilityRequest(string name, string subnetId) /// partial void CustomInit(); + /// /// Gets or sets file path to verify. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the Azure Resource URI for a delegated subnet. Must - /// have the delegation Microsoft.NetApp/volumes + /// Gets or sets the Azure Resource URI for a delegated subnet. Must have the + /// delegation Microsoft.NetApp/volumes /// - [JsonProperty(PropertyName = "subnetId")] - public string SubnetId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetId")] + public string SubnetId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (SubnetId == null) + if (this.SubnetId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SubnetId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SubnetId"); } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserRequest.cs index 93bb313ea775..575d10973765 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserRequest.cs @@ -1,42 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// /// Get group Id list for LDAP User request /// - public partial class GetGroupIdListForLDAPUserRequest + public partial class GetGroupIdListForLdapUserRequest { /// - /// Initializes a new instance of the GetGroupIdListForLDAPUserRequest - /// class. + /// Initializes a new instance of the GetGroupIdListForLdapUserRequest class. /// - public GetGroupIdListForLDAPUserRequest() + public GetGroupIdListForLdapUserRequest() { CustomInit(); } /// - /// Initializes a new instance of the GetGroupIdListForLDAPUserRequest - /// class. + /// Initializes a new instance of the GetGroupIdListForLdapUserRequest class. /// - /// username is required to fetch the group to - /// which user is part of - public GetGroupIdListForLDAPUserRequest(string username) + + /// username is required to fetch the group to which user is part of + /// + public GetGroupIdListForLdapUserRequest(string username) + { - Username = username; + this.Username = username; CustomInit(); } @@ -45,36 +38,36 @@ public GetGroupIdListForLDAPUserRequest(string username) /// partial void CustomInit(); + /// - /// Gets or sets username is required to fetch the group to which user - /// is part of + /// Gets or sets username is required to fetch the group to which user is part + /// of /// - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "username")] + public string Username {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Username == null) + if (this.Username == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Username"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Username"); } - if (Username != null) + if (this.Username != null) { - if (Username.Length > 255) + if (this.Username.Length > 255) { - throw new ValidationException(ValidationRules.MaxLength, "Username", 255); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "Username", 255); } - if (Username.Length < 1) + if (this.Username.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Username", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Username", 1); } } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserResponse.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserResponse.cs index f401f1668dd5..3e958ce99e88 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserResponse.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/GetGroupIdListForLDAPUserResponse.cs @@ -1,42 +1,35 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Group Id list for Ldap user /// - public partial class GetGroupIdListForLDAPUserResponse + public partial class GetGroupIdListForLdapUserResponse { /// - /// Initializes a new instance of the GetGroupIdListForLDAPUserResponse - /// class. + /// Initializes a new instance of the GetGroupIdListForLdapUserResponse class. /// - public GetGroupIdListForLDAPUserResponse() + public GetGroupIdListForLdapUserResponse() { CustomInit(); } /// - /// Initializes a new instance of the GetGroupIdListForLDAPUserResponse - /// class. + /// Initializes a new instance of the GetGroupIdListForLdapUserResponse class. /// - /// Group Id list - public GetGroupIdListForLDAPUserResponse(IList groupIdsForLdapUser = default(IList)) + + /// Group Id list + /// + public GetGroupIdListForLdapUserResponse(System.Collections.Generic.IList groupIdsForLdapUser = default(System.Collections.Generic.IList)) + { - GroupIdsForLdapUser = groupIdsForLdapUser; + this.GroupIdsForLdapUser = groupIdsForLdapUser; CustomInit(); } @@ -45,11 +38,11 @@ public GetGroupIdListForLDAPUserResponse() /// partial void CustomInit(); + /// /// Gets or sets group Id list /// - [JsonProperty(PropertyName = "groupIdsForLdapUser")] - public IList GroupIdsForLdapUser { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "groupIdsForLdapUser")] + public System.Collections.Generic.IList GroupIdsForLdapUser {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/HourlySchedule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/HourlySchedule.cs index bae544ec698c..6139e7ad76ed 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/HourlySchedule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/HourlySchedule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public HourlySchedule() /// /// Initializes a new instance of the HourlySchedule class. /// - /// Hourly snapshot count to keep - /// Indicates which minute snapshot should be - /// taken - /// Resource size in bytes, current storage - /// usage for the volume in bytes + + /// Hourly snapshot count to keep + /// + + /// Indicates which minute snapshot should be taken + /// + + /// Resource size in bytes, current storage usage for the volume in bytes + /// public HourlySchedule(int? snapshotsToKeep = default(int?), int? minute = default(int?), long? usedBytes = default(long?)) + { - SnapshotsToKeep = snapshotsToKeep; - Minute = minute; - UsedBytes = usedBytes; + this.SnapshotsToKeep = snapshotsToKeep; + this.Minute = minute; + this.UsedBytes = usedBytes; CustomInit(); } @@ -47,24 +46,24 @@ public HourlySchedule() /// partial void CustomInit(); + /// /// Gets or sets hourly snapshot count to keep /// - [JsonProperty(PropertyName = "snapshotsToKeep")] - public int? SnapshotsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotsToKeep")] + public int? SnapshotsToKeep {get; set; } /// /// Gets or sets indicates which minute snapshot should be taken /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minute")] + public int? Minute {get; set; } /// - /// Gets or sets resource size in bytes, current storage usage for the - /// volume in bytes + /// Gets or sets resource size in bytes, current storage usage for the volume + /// in bytes /// - [JsonProperty(PropertyName = "usedBytes")] - public long? UsedBytes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "usedBytes")] + public long? UsedBytes {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Identity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Identity.cs deleted file mode 100644 index b6651d15e923..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Identity.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identity for the resource. - /// - public partial class Identity - { - /// - /// Initializes a new instance of the Identity class. - /// - public Identity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Identity class. - /// - /// The principal ID of resource - /// identity. - /// The tenant ID of resource. - /// The identity type. Possible values include: - /// 'SystemAssigned' - public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) - { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the principal ID of resource identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } - - /// - /// Gets the tenant ID of resource. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets or sets the identity type. Possible values include: - /// 'SystemAssigned' - /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } - - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/InAvailabilityReasonType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/InAvailabilityReasonType.cs index 38222a0a0b92..606711ef0145 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/InAvailabilityReasonType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/InAvailabilityReasonType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for InAvailabilityReasonType. /// + + public static class InAvailabilityReasonType { public const string Invalid = "Invalid"; public const string AlreadyExists = "AlreadyExists"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeySource.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeySource.cs index 33c16e7d9762..6e24779d5be8 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeySource.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeySource.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for KeySource. /// + + public static class KeySource { /// @@ -25,4 +22,4 @@ public static class KeySource /// public const string MicrosoftKeyVault = "Microsoft.KeyVault"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultProperties.cs index 85ed9a341b7c..f3f364a88726 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultProperties.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultProperties.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,22 +23,29 @@ public KeyVaultProperties() /// /// Initializes a new instance of the KeyVaultProperties class. /// - /// The Uri of KeyVault. - /// The name of KeyVault key. - /// The resource ID of - /// KeyVault. - /// UUID v4 used to identify the Azure Key - /// Vault configuration - /// Status of the KeyVault connection. Possible - /// values include: 'Created', 'InUse', 'Deleted', 'Error', - /// 'Updating' + + /// UUID v4 used to identify the Azure Key Vault configuration + /// + + /// The Uri of KeyVault. + /// + + /// The name of KeyVault key. + /// + + /// The resource ID of KeyVault. + /// + + /// Status of the KeyVault connection. + /// Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating' public KeyVaultProperties(string keyVaultUri, string keyName, string keyVaultResourceId, string keyVaultId = default(string), string status = default(string)) + { - KeyVaultId = keyVaultId; - KeyVaultUri = keyVaultUri; - KeyName = keyName; - KeyVaultResourceId = keyVaultResourceId; - Status = status; + this.KeyVaultId = keyVaultId; + this.KeyVaultUri = keyVaultUri; + this.KeyName = keyName; + this.KeyVaultResourceId = keyVaultResourceId; + this.Status = status; CustomInit(); } @@ -54,72 +54,75 @@ public KeyVaultProperties() /// partial void CustomInit(); + /// - /// Gets UUID v4 used to identify the Azure Key Vault configuration + /// Gets uUID v4 used to identify the Azure Key Vault configuration /// - [JsonProperty(PropertyName = "keyVaultId")] - public string KeyVaultId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultId")] + public string KeyVaultId {get; private set; } /// /// Gets or sets the Uri of KeyVault. /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri {get; set; } /// /// Gets or sets the name of KeyVault key. /// - [JsonProperty(PropertyName = "keyName")] - public string KeyName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyName")] + public string KeyName {get; set; } /// /// Gets or sets the resource ID of KeyVault. /// - [JsonProperty(PropertyName = "keyVaultResourceId")] - public string KeyVaultResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultResourceId")] + public string KeyVaultResourceId {get; set; } /// - /// Gets status of the KeyVault connection. Possible values include: - /// 'Created', 'InUse', 'Deleted', 'Error', 'Updating' + /// Gets status of the KeyVault connection. Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (KeyVaultUri == null) + if (this.KeyVaultUri == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultUri"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "KeyVaultUri"); } - if (KeyName == null) + if (this.KeyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "KeyName"); } - if (KeyVaultResourceId == null) + if (this.KeyVaultResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "KeyVaultResourceId"); } - if (KeyVaultId != null) + if (this.KeyVaultId != null) { - if (KeyVaultId.Length > 36) + if (this.KeyVaultId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "KeyVaultId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "KeyVaultId", 36); } - if (KeyVaultId.Length < 36) + if (this.KeyVaultId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "KeyVaultId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "KeyVaultId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(KeyVaultId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.KeyVaultId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "KeyVaultId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "KeyVaultId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultStatus.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultStatus.cs index 04e9c42a4fff..e9aa5e47205e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultStatus.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/KeyVaultStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for KeyVaultStatus. /// + + public static class KeyVaultStatus { /// @@ -37,4 +34,4 @@ public static class KeyVaultStatus /// public const string Updating = "Updating"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LdapSearchScopeOpt.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LdapSearchScopeOpt.cs index 690f836aa36b..9fefb66c453a 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LdapSearchScopeOpt.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LdapSearchScopeOpt.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,18 +23,22 @@ public LdapSearchScopeOpt() /// /// Initializes a new instance of the LdapSearchScopeOpt class. /// - /// This specifies the user DN, which overrides - /// the base DN for user lookups. - /// This specifies the group DN, which overrides - /// the base DN for group lookups. - /// This specifies the custom LDAP - /// search filter to be used when looking up group membership from LDAP - /// server. - public LdapSearchScopeOpt(string userDN = default(string), string groupDN = default(string), string groupMembershipFilter = default(string)) + + /// This specifies the user DN, which overrides the base DN for user lookups. + /// + + /// This specifies the group DN, which overrides the base DN for group lookups. + /// + + /// This specifies the custom LDAP search filter to be used when looking up + /// group membership from LDAP server. + /// + public LdapSearchScopeOpt(string userDn = default(string), string groupDn = default(string), string groupMembershipFilter = default(string)) + { - UserDN = userDN; - GroupDN = groupDN; - GroupMembershipFilter = groupMembershipFilter; + this.UserDn = userDn; + this.GroupDn = groupDn; + this.GroupMembershipFilter = groupMembershipFilter; CustomInit(); } @@ -50,56 +47,56 @@ public LdapSearchScopeOpt() /// partial void CustomInit(); + /// - /// Gets or sets this specifies the user DN, which overrides the base - /// DN for user lookups. + /// Gets or sets this specifies the user DN, which overrides the base DN for + /// user lookups. /// - [JsonProperty(PropertyName = "userDN")] - public string UserDN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "userDN")] + public string UserDn {get; set; } /// - /// Gets or sets this specifies the group DN, which overrides the base - /// DN for group lookups. + /// Gets or sets this specifies the group DN, which overrides the base DN for + /// group lookups. /// - [JsonProperty(PropertyName = "groupDN")] - public string GroupDN { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupDN")] + public string GroupDn {get; set; } /// - /// Gets or sets this specifies the custom LDAP search filter to be - /// used when looking up group membership from LDAP server. + /// Gets or sets this specifies the custom LDAP search filter to be used when + /// looking up group membership from LDAP server. /// - [JsonProperty(PropertyName = "groupMembershipFilter")] - public string GroupMembershipFilter { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "groupMembershipFilter")] + public string GroupMembershipFilter {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (UserDN != null) + if (this.UserDn != null) { - if (UserDN.Length > 255) + if (this.UserDn.Length > 255) { - throw new ValidationException(ValidationRules.MaxLength, "UserDN", 255); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "UserDn", 255); } } - if (GroupDN != null) + if (this.GroupDn != null) { - if (GroupDN.Length > 255) + if (this.GroupDn.Length > 255) { - throw new ValidationException(ValidationRules.MaxLength, "GroupDN", 255); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "GroupDn", 255); } } - if (GroupMembershipFilter != null) + if (this.GroupMembershipFilter != null) { - if (GroupMembershipFilter.Length > 255) + if (this.GroupMembershipFilter.Length > 255) { - throw new ValidationException(ValidationRules.MaxLength, "GroupMembershipFilter", 255); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "GroupMembershipFilter", 255); } } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LogSpecification.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LogSpecification.cs index 26eb5b9e27f7..93704a4e3dc9 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LogSpecification.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/LogSpecification.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public LogSpecification() /// /// Initializes a new instance of the LogSpecification class. /// - /// Name of log specification. - /// Display name of log - /// specification. + + /// Name of log specification. + /// + + /// Display name of log specification. + /// public LogSpecification(string name = default(string), string displayName = default(string)) + { - Name = name; - DisplayName = displayName; + this.Name = name; + this.DisplayName = displayName; CustomInit(); } @@ -44,17 +42,17 @@ public LogSpecification() /// partial void CustomInit(); + /// /// Gets or sets name of log specification. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets display name of log specification. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs index 6ebec69a1e3d..906e9c8b3fbc 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs @@ -1,24 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Managed service identity (system assigned and/or user assigned - /// identities) + /// Managed service identity (system assigned and/or user assigned identities) /// public partial class ManagedServiceIdentity { @@ -33,21 +23,33 @@ public ManagedServiceIdentity() /// /// Initializes a new instance of the ManagedServiceIdentity class. /// - /// Possible values include: 'None', - /// 'SystemAssigned', 'UserAssigned', + + /// The service principal ID of the system assigned identity. This property + /// will only be provided for a system assigned identity. + /// + + /// The tenant ID of the system assigned identity. This property will only be + /// provided for a system assigned identity. + /// + + /// Type of managed service identity (where both SystemAssigned and + /// UserAssigned types are allowed). + /// Possible values include: 'None', 'SystemAssigned', 'UserAssigned', /// 'SystemAssigned,UserAssigned' - /// The service principal ID of the system - /// assigned identity. This property will only be provided for a system - /// assigned identity. - /// The tenant ID of the system assigned - /// identity. This property will only be provided for a system assigned - /// identity. - public ManagedServiceIdentity(string type, System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The set of user assigned identities associated with the resource. The + /// userAssignedIdentities dictionary keys will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + /// The dictionary values can be empty objects ({}) in requests. + /// + public ManagedServiceIdentity(string type, System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -56,44 +58,51 @@ public ManagedServiceIdentity() /// partial void CustomInit(); + /// /// Gets the service principal ID of the system assigned identity. This /// property will only be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public System.Guid? PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public System.Guid? PrincipalId {get; private set; } /// - /// Gets the tenant ID of the system assigned identity. This property - /// will only be provided for a system assigned identity. + /// Gets the tenant ID of the system assigned identity. This property will only + /// be provided for a system assigned identity. /// - [JsonProperty(PropertyName = "tenantId")] - public System.Guid? TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public System.Guid? TenantId {get; private set; } /// - /// Gets or sets possible values include: 'None', 'SystemAssigned', - /// 'UserAssigned', 'SystemAssigned,UserAssigned' + /// Gets or sets type of managed service identity (where both SystemAssigned + /// and UserAssigned types are allowed). Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// + /// Gets or sets the set of user assigned identities associated with the + /// resource. The userAssignedIdentities dictionary keys will be ARM resource + /// ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + /// The dictionary values can be empty objects ({}) in requests. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Type == null) + if (this.Type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs index 3b6e5d0ce017..ac3671519717 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for ManagedServiceIdentityType. /// + + public static class ManagedServiceIdentityType { public const string None = "None"; @@ -21,4 +18,4 @@ public static class ManagedServiceIdentityType public const string UserAssigned = "UserAssigned"; public const string SystemAssignedUserAssigned = "SystemAssigned,UserAssigned"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricAggregationType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricAggregationType.cs index c2dd2f5d1c48..da719e1110e1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricAggregationType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricAggregationType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for MetricAggregationType. /// + + public static class MetricAggregationType { public const string Average = "Average"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricSpecification.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricSpecification.cs index 2fef0116ee13..c96051e24075 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricSpecification.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MetricSpecification.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,50 +23,73 @@ public MetricSpecification() /// /// Initializes a new instance of the MetricSpecification class. /// - /// Name of metric specification. - /// Display name of metric - /// specification. - /// Display description of metric - /// specification. - /// Unit could be Bytes or Count. - /// Support metric aggregation - /// type. - /// The supported time grain - /// types for the metrics. - /// The internal metric name. - /// Whether or not the service - /// is using regional MDM accounts. - /// The source MDM account. - /// The source MDM namespace. - /// Dimensions of blobs, including blob type - /// and access tier. - /// Aggregation type could be - /// Average. - /// The property to decide fill gap with - /// zero or not. - /// The category this metric specification - /// belong to, could be Capacity. - /// Account Resource - /// Id. - /// Whether the metric is internal. - public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), IList supportedAggregationTypes = default(IList), IList supportedTimeGrainTypes = default(IList), string internalMetricName = default(string), bool? enableRegionalMdmAccount = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), IList dimensions = default(IList), string aggregationType = default(string), bool? fillGapWithZero = default(bool?), string category = default(string), string resourceIdDimensionNameOverride = default(string), bool? isInternal = default(bool?)) + + /// Name of metric specification. + /// + + /// Display name of metric specification. + /// + + /// Display description of metric specification. + /// + + /// Unit could be Bytes or Count. + /// + + /// Support metric aggregation type. + /// + + /// The supported time grain types for the metrics. + /// + + /// The internal metric name. + /// + + /// Whether or not the service is using regional MDM accounts. + /// + + /// The source MDM account. + /// + + /// The source MDM namespace. + /// + + /// Dimensions of blobs, including blob type and access tier. + /// + + /// Aggregation type could be Average. + /// + + /// The property to decide fill gap with zero or not. + /// + + /// The category this metric specification belong to, could be Capacity. + /// + + /// Account Resource Id. + /// + + /// Whether the metric is internal. + /// + public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), System.Collections.Generic.IList supportedAggregationTypes = default(System.Collections.Generic.IList), System.Collections.Generic.IList supportedTimeGrainTypes = default(System.Collections.Generic.IList), string internalMetricName = default(string), bool? enableRegionalMdmAccount = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), System.Collections.Generic.IList dimensions = default(System.Collections.Generic.IList), string aggregationType = default(string), bool? fillGapWithZero = default(bool?), string category = default(string), string resourceIdDimensionNameOverride = default(string), bool? isInternal = default(bool?)) + { - Name = name; - DisplayName = displayName; - DisplayDescription = displayDescription; - Unit = unit; - SupportedAggregationTypes = supportedAggregationTypes; - SupportedTimeGrainTypes = supportedTimeGrainTypes; - InternalMetricName = internalMetricName; - EnableRegionalMdmAccount = enableRegionalMdmAccount; - SourceMdmAccount = sourceMdmAccount; - SourceMdmNamespace = sourceMdmNamespace; - Dimensions = dimensions; - AggregationType = aggregationType; - FillGapWithZero = fillGapWithZero; - Category = category; - ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; - IsInternal = isInternal; + this.Name = name; + this.DisplayName = displayName; + this.DisplayDescription = displayDescription; + this.Unit = unit; + this.SupportedAggregationTypes = supportedAggregationTypes; + this.SupportedTimeGrainTypes = supportedTimeGrainTypes; + this.InternalMetricName = internalMetricName; + this.EnableRegionalMdmAccount = enableRegionalMdmAccount; + this.SourceMdmAccount = sourceMdmAccount; + this.SourceMdmNamespace = sourceMdmNamespace; + this.Dimensions = dimensions; + this.AggregationType = aggregationType; + this.FillGapWithZero = fillGapWithZero; + this.Category = category; + this.ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + this.IsInternal = isInternal; CustomInit(); } @@ -83,104 +98,102 @@ public MetricSpecification() /// partial void CustomInit(); + /// /// Gets or sets name of metric specification. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets display name of metric specification. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets display description of metric specification. /// - [JsonProperty(PropertyName = "displayDescription")] - public string DisplayDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription {get; set; } /// /// Gets or sets unit could be Bytes or Count. /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public string Unit {get; set; } /// /// Gets or sets support metric aggregation type. /// - [JsonProperty(PropertyName = "supportedAggregationTypes")] - public IList SupportedAggregationTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedAggregationTypes")] + public System.Collections.Generic.IList SupportedAggregationTypes {get; set; } /// /// Gets or sets the supported time grain types for the metrics. /// - [JsonProperty(PropertyName = "supportedTimeGrainTypes")] - public IList SupportedTimeGrainTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "supportedTimeGrainTypes")] + public System.Collections.Generic.IList SupportedTimeGrainTypes {get; set; } /// /// Gets or sets the internal metric name. /// - [JsonProperty(PropertyName = "internalMetricName")] - public string InternalMetricName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "internalMetricName")] + public string InternalMetricName {get; set; } /// - /// Gets or sets whether or not the service is using regional MDM - /// accounts. + /// Gets or sets whether or not the service is using regional MDM accounts. /// - [JsonProperty(PropertyName = "enableRegionalMdmAccount")] - public bool? EnableRegionalMdmAccount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableRegionalMdmAccount")] + public bool? EnableRegionalMdmAccount {get; set; } /// /// Gets or sets the source MDM account. /// - [JsonProperty(PropertyName = "sourceMdmAccount")] - public string SourceMdmAccount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceMdmAccount")] + public string SourceMdmAccount {get; set; } /// /// Gets or sets the source MDM namespace. /// - [JsonProperty(PropertyName = "sourceMdmNamespace")] - public string SourceMdmNamespace { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceMdmNamespace")] + public string SourceMdmNamespace {get; set; } /// - /// Gets or sets dimensions of blobs, including blob type and access - /// tier. + /// Gets or sets dimensions of blobs, including blob type and access tier. /// - [JsonProperty(PropertyName = "dimensions")] - public IList Dimensions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dimensions")] + public System.Collections.Generic.IList Dimensions {get; set; } /// /// Gets or sets aggregation type could be Average. /// - [JsonProperty(PropertyName = "aggregationType")] - public string AggregationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregationType")] + public string AggregationType {get; set; } /// /// Gets or sets the property to decide fill gap with zero or not. /// - [JsonProperty(PropertyName = "fillGapWithZero")] - public bool? FillGapWithZero { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fillGapWithZero")] + public bool? FillGapWithZero {get; set; } /// - /// Gets or sets the category this metric specification belong to, - /// could be Capacity. + /// Gets or sets the category this metric specification belong to, could be + /// Capacity. /// - [JsonProperty(PropertyName = "category")] - public string Category { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + public string Category {get; set; } /// /// Gets or sets account Resource Id. /// - [JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] - public string ResourceIdDimensionNameOverride { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] + public string ResourceIdDimensionNameOverride {get; set; } /// /// Gets or sets whether the metric is internal. /// - [JsonProperty(PropertyName = "isInternal")] - public bool? IsInternal { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isInternal")] + public bool? IsInternal {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MirrorState.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MirrorState.cs index 33b18a5e57cb..6b0d27df0050 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MirrorState.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MirrorState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for MirrorState. /// + + public static class MirrorState { public const string Uninitialized = "Uninitialized"; public const string Mirrored = "Mirrored"; public const string Broken = "Broken"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MonthlySchedule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MonthlySchedule.cs index 4444c2937f08..169a0e86fa72 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MonthlySchedule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MonthlySchedule.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,23 +23,30 @@ public MonthlySchedule() /// /// Initializes a new instance of the MonthlySchedule class. /// - /// Monthly snapshot count to - /// keep - /// Indicates which days of the month - /// snapshot should be taken. A comma delimited string. - /// Indicates which hour in UTC timezone a snapshot - /// should be taken - /// Indicates which minute snapshot should be - /// taken - /// Resource size in bytes, current storage - /// usage for the volume in bytes + + /// Monthly snapshot count to keep + /// + + /// Indicates which days of the month snapshot should be taken. A comma + /// delimited string. + /// + + /// Indicates which hour in UTC timezone a snapshot should be taken + /// + + /// Indicates which minute snapshot should be taken + /// + + /// Resource size in bytes, current storage usage for the volume in bytes + /// public MonthlySchedule(int? snapshotsToKeep = default(int?), string daysOfMonth = default(string), int? hour = default(int?), int? minute = default(int?), long? usedBytes = default(long?)) + { - SnapshotsToKeep = snapshotsToKeep; - DaysOfMonth = daysOfMonth; - Hour = hour; - Minute = minute; - UsedBytes = usedBytes; + this.SnapshotsToKeep = snapshotsToKeep; + this.DaysOfMonth = daysOfMonth; + this.Hour = hour; + this.Minute = minute; + this.UsedBytes = usedBytes; CustomInit(); } @@ -54,38 +55,38 @@ public MonthlySchedule() /// partial void CustomInit(); + /// /// Gets or sets monthly snapshot count to keep /// - [JsonProperty(PropertyName = "snapshotsToKeep")] - public int? SnapshotsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotsToKeep")] + public int? SnapshotsToKeep {get; set; } /// - /// Gets or sets indicates which days of the month snapshot should be - /// taken. A comma delimited string. + /// Gets or sets indicates which days of the month snapshot should be taken. A + /// comma delimited string. /// - [JsonProperty(PropertyName = "daysOfMonth")] - public string DaysOfMonth { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "daysOfMonth")] + public string DaysOfMonth {get; set; } /// - /// Gets or sets indicates which hour in UTC timezone a snapshot should - /// be taken + /// Gets or sets indicates which hour in UTC timezone a snapshot should be + /// taken /// - [JsonProperty(PropertyName = "hour")] - public int? Hour { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hour")] + public int? Hour {get; set; } /// /// Gets or sets indicates which minute snapshot should be taken /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minute")] + public int? Minute {get; set; } /// - /// Gets or sets resource size in bytes, current storage usage for the - /// volume in bytes + /// Gets or sets resource size in bytes, current storage usage for the volume + /// in bytes /// - [JsonProperty(PropertyName = "usedBytes")] - public long? UsedBytes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "usedBytes")] + public long? UsedBytes {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTarget.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTarget.cs index 09dbdcc69947..8980fc0e3698 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTarget.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTarget.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Mount Target /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class MountTarget { /// @@ -34,26 +24,45 @@ public MountTarget() /// /// Initializes a new instance of the MountTarget class. /// - /// Resource location - /// fileSystemId - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// mountTargetId - /// ipAddress - /// smbServerFQDN - public MountTarget(string location, string fileSystemId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string mountTargetId = default(string), string ipAddress = default(string), string smbServerFqdn = default(string)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// UUID v4 used to identify the MountTarget + /// + + /// UUID v4 used to identify the MountTarget + /// + + /// The mount target's IPv4 address + /// + + /// The SMB server's Fully Qualified Domain Name, FQDN + /// + public MountTarget(string location, string fileSystemId, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string mountTargetId = default(string), string ipAddress = default(string), string smbServerFqdn = default(string)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - MountTargetId = mountTargetId; - FileSystemId = fileSystemId; - IpAddress = ipAddress; - SmbServerFqdn = smbServerFqdn; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.MountTargetId = mountTargetId; + this.FileSystemId = fileSystemId; + this.IPAddress = ipAddress; + this.SmbServerFqdn = smbServerFqdn; CustomInit(); } @@ -62,118 +71,113 @@ public MountTarget() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets mountTargetId + /// Gets uUID v4 used to identify the MountTarget /// - /// - /// UUID v4 used to identify the MountTarget - /// - [JsonProperty(PropertyName = "properties.mountTargetId")] - public string MountTargetId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mountTargetId")] + public string MountTargetId {get; private set; } /// - /// Gets or sets fileSystemId + /// Gets or sets uUID v4 used to identify the MountTarget /// - /// - /// UUID v4 used to identify the MountTarget - /// - [JsonProperty(PropertyName = "properties.fileSystemId")] - public string FileSystemId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fileSystemId")] + public string FileSystemId {get; set; } /// - /// Gets ipAddress + /// Gets the mount target's IPv4 address /// - /// - /// The mount target's IPv4 address - /// - [JsonProperty(PropertyName = "properties.ipAddress")] - public string IpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipAddress")] + public string IPAddress {get; private set; } /// - /// Gets or sets smbServerFQDN + /// Gets or sets the SMB server's Fully Qualified Domain Name, FQDN /// - /// - /// The SMB server's Fully Qualified Domain Name, FQDN - /// - [JsonProperty(PropertyName = "properties.smbServerFqdn")] - public string SmbServerFqdn { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbServerFqdn")] + public string SmbServerFqdn {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } - if (FileSystemId == null) + if (this.FileSystemId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "FileSystemId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FileSystemId"); } - if (MountTargetId != null) + + + + + + if (this.MountTargetId != null) { - if (MountTargetId.Length > 36) + if (this.MountTargetId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "MountTargetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "MountTargetId", 36); } - if (MountTargetId.Length < 36) + if (this.MountTargetId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "MountTargetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "MountTargetId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(MountTargetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.MountTargetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "MountTargetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "MountTargetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } - if (FileSystemId != null) + if (this.FileSystemId != null) { - if (FileSystemId.Length > 36) + if (this.FileSystemId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "FileSystemId", 36); } - if (FileSystemId.Length < 36) + if (this.FileSystemId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "FileSystemId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTargetProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTargetProperties.cs index f9ba6a5e630c..b7004c7a4b5c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTargetProperties.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/MountTargetProperties.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,16 +23,25 @@ public MountTargetProperties() /// /// Initializes a new instance of the MountTargetProperties class. /// - /// fileSystemId - /// mountTargetId - /// ipAddress - /// smbServerFQDN + + /// UUID v4 used to identify the MountTarget + /// + + /// UUID v4 used to identify the MountTarget + /// + + /// The mount target's IPv4 address + /// + + /// The SMB server's Fully Qualified Domain Name, FQDN + /// public MountTargetProperties(string fileSystemId, string mountTargetId = default(string), string ipAddress = default(string), string smbServerFqdn = default(string)) + { - MountTargetId = mountTargetId; - FileSystemId = fileSystemId; - IpAddress = ipAddress; - SmbServerFqdn = smbServerFqdn; + this.MountTargetId = mountTargetId; + this.FileSystemId = fileSystemId; + this.IPAddress = ipAddress; + this.SmbServerFqdn = smbServerFqdn; CustomInit(); } @@ -48,84 +50,74 @@ public MountTargetProperties() /// partial void CustomInit(); + /// - /// Gets mountTargetId + /// Gets uUID v4 used to identify the MountTarget /// - /// - /// UUID v4 used to identify the MountTarget - /// - [JsonProperty(PropertyName = "mountTargetId")] - public string MountTargetId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mountTargetId")] + public string MountTargetId {get; private set; } /// - /// Gets or sets fileSystemId + /// Gets or sets uUID v4 used to identify the MountTarget /// - /// - /// UUID v4 used to identify the MountTarget - /// - [JsonProperty(PropertyName = "fileSystemId")] - public string FileSystemId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "fileSystemId")] + public string FileSystemId {get; set; } /// - /// Gets ipAddress + /// Gets the mount target's IPv4 address /// - /// - /// The mount target's IPv4 address - /// - [JsonProperty(PropertyName = "ipAddress")] - public string IpAddress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "ipAddress")] + public string IPAddress {get; private set; } /// - /// Gets or sets smbServerFQDN + /// Gets or sets the SMB server's Fully Qualified Domain Name, FQDN /// - /// - /// The SMB server's Fully Qualified Domain Name, FQDN - /// - [JsonProperty(PropertyName = "smbServerFqdn")] - public string SmbServerFqdn { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "smbServerFqdn")] + public string SmbServerFqdn {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (FileSystemId == null) + if (this.FileSystemId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "FileSystemId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FileSystemId"); } - if (MountTargetId != null) + if (this.MountTargetId != null) { - if (MountTargetId.Length > 36) + if (this.MountTargetId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "MountTargetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "MountTargetId", 36); } - if (MountTargetId.Length < 36) + if (this.MountTargetId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "MountTargetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "MountTargetId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(MountTargetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.MountTargetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "MountTargetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "MountTargetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } - if (FileSystemId != null) + if (this.FileSystemId != null) { - if (FileSystemId.Length > 36) + if (this.FileSystemId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "FileSystemId", 36); } - if (FileSystemId.Length < 36) + if (this.FileSystemId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "FileSystemId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccount.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccount.cs index 3fd9f9eb8756..fd9fc4771097 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccount.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccount.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NetApp account resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class NetAppAccount : TrackedResource { /// @@ -34,34 +24,56 @@ public NetAppAccount() /// /// Initializes a new instance of the NetAppAccount class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Azure lifecycle management - /// Active Directories - /// Encryption settings - /// Shows the status of disableShowmount - /// for all volumes under the subscription, null equals false - /// The identity used for the resource. - public NetAppAccount(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), string provisioningState = default(string), IList activeDirectories = default(IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(location, id, name, type, systemData, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// The identity used for the resource. + /// + + /// Azure lifecycle management + /// + + /// Active Directories + /// + + /// Encryption settings + /// + + /// Shows the status of disableShowmount for all volumes under the + /// subscription, null equals false + /// + public NetAppAccount(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), System.Collections.Generic.IList activeDirectories = default(System.Collections.Generic.IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?)) + + : base(location, id, name, type, systemData, tags) { - Etag = etag; - ProvisioningState = provisioningState; - ActiveDirectories = activeDirectories; - Encryption = encryption; - DisableShowmount = disableShowmount; - Identity = identity; + this.Etag = etag; + this.Identity = identity; + this.ProvisioningState = provisioningState; + this.ActiveDirectories = activeDirectories; + this.Encryption = encryption; + this.DisableShowmount = disableShowmount; CustomInit(); } @@ -70,56 +82,62 @@ public NetAppAccount() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } + + /// + /// Gets or sets the identity used for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets active Directories /// - [JsonProperty(PropertyName = "properties.activeDirectories")] - public IList ActiveDirectories { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeDirectories")] + public System.Collections.Generic.IList ActiveDirectories {get; set; } /// /// Gets or sets encryption settings /// - [JsonProperty(PropertyName = "properties.encryption")] - public AccountEncryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public AccountEncryption Encryption {get; set; } /// /// Gets shows the status of disableShowmount for all volumes under the /// subscription, null equals false /// - [JsonProperty(PropertyName = "properties.disableShowmount")] - public bool? DisableShowmount { get; private set; } - - /// - /// Gets or sets the identity used for the resource. - /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableShowmount")] + public bool? DisableShowmount {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (ActiveDirectories != null) + + if (this.Identity != null) { - foreach (var element in ActiveDirectories) + this.Identity.Validate(); + } + + if (this.ActiveDirectories != null) + { + foreach (var element in this.ActiveDirectories) { if (element != null) { @@ -127,14 +145,10 @@ public override void Validate() } } } - if (Encryption != null) - { - Encryption.Validate(); - } - if (Identity != null) + if (this.Encryption != null) { - Identity.Validate(); + this.Encryption.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccountPatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccountPatch.cs index b7d41d03a0f6..64cd715845fa 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccountPatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetAppAccountPatch.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// NetApp account patch resource /// - [Rest.Serialization.JsonTransformation] - public partial class NetAppAccountPatch : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class NetAppAccountPatch : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the NetAppAccountPatch class. @@ -35,29 +24,50 @@ public NetAppAccountPatch() /// /// Initializes a new instance of the NetAppAccountPatch class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// Azure lifecycle management - /// Active Directories - /// Encryption settings - /// Shows the status of disableShowmount - /// for all volumes under the subscription, null equals false - /// The identity used for the resource. - public NetAppAccountPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList activeDirectories = default(IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// The identity used for the resource. + /// + + /// Azure lifecycle management + /// + + /// Active Directories + /// + + /// Encryption settings + /// + + /// Shows the status of disableShowmount for all volumes under the + /// subscription, null equals false + /// + public NetAppAccountPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), System.Collections.Generic.IList activeDirectories = default(System.Collections.Generic.IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - ProvisioningState = provisioningState; - ActiveDirectories = activeDirectories; - Encryption = encryption; - DisableShowmount = disableShowmount; - Identity = identity; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.Identity = identity; + this.ProvisioningState = provisioningState; + this.ActiveDirectories = activeDirectories; + this.Encryption = encryption; + this.DisableShowmount = disableShowmount; CustomInit(); } @@ -66,78 +76,88 @@ public NetAppAccountPatch() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the identity used for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Gets or sets active Directories /// - [JsonProperty(PropertyName = "properties.activeDirectories")] - public IList ActiveDirectories { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeDirectories")] + public System.Collections.Generic.IList ActiveDirectories {get; set; } /// /// Gets or sets encryption settings /// - [JsonProperty(PropertyName = "properties.encryption")] - public AccountEncryption Encryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryption")] + public AccountEncryption Encryption {get; set; } /// /// Gets shows the status of disableShowmount for all volumes under the /// subscription, null equals false /// - [JsonProperty(PropertyName = "properties.disableShowmount")] - public bool? DisableShowmount { get; private set; } - - /// - /// Gets or sets the identity used for the resource. - /// - [JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.disableShowmount")] + public bool? DisableShowmount {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ActiveDirectories != null) + + + + + + if (this.Identity != null) + { + this.Identity.Validate(); + } + + if (this.ActiveDirectories != null) { - foreach (var element in ActiveDirectories) + foreach (var element in this.ActiveDirectories) { if (element != null) { @@ -145,14 +165,10 @@ public virtual void Validate() } } } - if (Encryption != null) - { - Encryption.Validate(); - } - if (Identity != null) + if (this.Encryption != null) { - Identity.Validate(); + this.Encryption.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetworkFeatures.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetworkFeatures.cs index b48f1ecee077..d8ab677dce56 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetworkFeatures.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/NetworkFeatures.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for NetworkFeatures. /// + + public static class NetworkFeatures { /// @@ -25,4 +22,4 @@ public static class NetworkFeatures /// public const string Standard = "Standard"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Operation.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Operation.cs index 3558eccfb9e4..12dcd5fb2318 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Operation.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Operation.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Microsoft.NetApp REST API operation definition. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Operation { /// @@ -32,19 +24,25 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Operation name: - /// {provider}/{resource}/{operation} - /// Display metadata associated with the - /// operation. - /// The origin of operations. - /// One property of operation, - /// include metric specifications. + + /// Operation name: {provider}/{resource}/{operation} + /// + + /// Display metadata associated with the operation. + /// + + /// The origin of operations. + /// + + /// One property of operation, include metric specifications. + /// public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string), ServiceSpecification serviceSpecification = default(ServiceSpecification)) + { - Name = name; - Display = display; - Origin = origin; - ServiceSpecification = serviceSpecification; + this.Name = name; + this.Display = display; + this.Origin = origin; + this.ServiceSpecification = serviceSpecification; CustomInit(); } @@ -53,30 +51,29 @@ public Operation() /// partial void CustomInit(); + /// /// Gets or sets operation name: {provider}/{resource}/{operation} /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets display metadata associated with the operation. /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } /// /// Gets or sets the origin of operations. /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; set; } /// - /// Gets or sets one property of operation, include metric - /// specifications. + /// Gets or sets one property of operation, include metric specifications. /// - [JsonProperty(PropertyName = "properties.serviceSpecification")] - public ServiceSpecification ServiceSpecification { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceSpecification")] + public ServiceSpecification ServiceSpecification {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationDisplay.cs index 21a016ff3766..a8bbeb6f1c38 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationDisplay.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,18 +23,25 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: Microsoft NetApp. - /// Resource on which the operation is performed - /// etc. - /// Type of operation: get, read, delete, - /// etc. - /// Operation description. + + /// Service provider: Microsoft NetApp. + /// + + /// Resource on which the operation is performed etc. + /// + + /// Type of operation: get, read, delete, etc. + /// + + /// Operation description. + /// public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -49,29 +50,29 @@ public OperationDisplay() /// partial void CustomInit(); + /// /// Gets or sets service provider: Microsoft NetApp. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets resource on which the operation is performed etc. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// /// Gets or sets type of operation: get, read, delete, etc. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets operation description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationProperties.cs new file mode 100644 index 000000000000..350f3418404c --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/OperationProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Properties of operation, include metric specifications. + /// + public partial class OperationProperties + { + /// + /// Initializes a new instance of the OperationProperties class. + /// + public OperationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationProperties class. + /// + + /// One property of operation, include metric specifications. + /// + public OperationProperties(ServiceSpecification serviceSpecification = default(ServiceSpecification)) + + { + this.ServiceSpecification = serviceSpecification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets one property of operation, include metric specifications. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceSpecification")] + public ServiceSpecification ServiceSpecification {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page.cs index 48b8e217fa20..4ec7daee0db0 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page1.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page1.cs index 0c8fd79cf5ec..e6966e7e4fd2 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page1.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Page1.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page1 : IPage + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PlacementKeyValuePairs.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PlacementKeyValuePairs.cs index 914e416ed968..a065bd154507 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PlacementKeyValuePairs.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PlacementKeyValuePairs.cs @@ -1,22 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// - /// Application specific parameters for the placement of volumes in the - /// volume group + /// Application specific parameters for the placement of volumes in the volume + /// group /// public partial class PlacementKeyValuePairs { @@ -31,14 +24,19 @@ public PlacementKeyValuePairs() /// /// Initializes a new instance of the PlacementKeyValuePairs class. /// - /// Key for an application specific parameter for the - /// placement of volumes in the volume group - /// Value for an application specific parameter for - /// the placement of volumes in the volume group + + /// Key for an application specific parameter for the placement of volumes in + /// the volume group + /// + + /// Value for an application specific parameter for the placement of volumes in + /// the volume group + /// public PlacementKeyValuePairs(string key, string value) + { - Key = key; - Value = value; + this.Key = key; + this.Value = value; CustomInit(); } @@ -47,36 +45,38 @@ public PlacementKeyValuePairs(string key, string value) /// partial void CustomInit(); + /// - /// Gets or sets key for an application specific parameter for the - /// placement of volumes in the volume group + /// Gets or sets key for an application specific parameter for the placement of + /// volumes in the volume group /// - [JsonProperty(PropertyName = "key")] - public string Key { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "key")] + public string Key {get; set; } /// - /// Gets or sets value for an application specific parameter for the - /// placement of volumes in the volume group + /// Gets or sets value for an application specific parameter for the placement + /// of volumes in the volume group /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Key == null) + if (this.Key == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Key"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Key"); } - if (Value == null) + if (this.Value == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Plan.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Plan.cs deleted file mode 100644 index 43f0a7ce3aff..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Plan.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Plan for the resource. - /// - public partial class Plan - { - /// - /// Initializes a new instance of the Plan class. - /// - public Plan() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Plan class. - /// - /// A user defined name of the 3rd Party Artifact - /// that is being procured. - /// The publisher of the 3rd Party Artifact - /// that is being bought. E.g. NewRelic - /// The 3rd Party artifact that is being - /// procured. E.g. NewRelic. Product maps to the OfferID specified for - /// the artifact at the time of Data Market onboarding. - /// A publisher provided promotion code as - /// provisioned in Data Market for the said product/artifact. - /// The version of the desired - /// product/artifact. - public Plan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) - { - Name = name; - Publisher = publisher; - Product = product; - PromotionCode = promotionCode; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a user defined name of the 3rd Party Artifact that is - /// being procured. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the publisher of the 3rd Party Artifact that is being - /// bought. E.g. NewRelic - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets the 3rd Party artifact that is being procured. E.g. - /// NewRelic. Product maps to the OfferID specified for the artifact at - /// the time of Data Market onboarding. - /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } - - /// - /// Gets or sets a publisher provided promotion code as provisioned in - /// Data Market for the said product/artifact. - /// - [JsonProperty(PropertyName = "promotionCode")] - public string PromotionCode { get; set; } - - /// - /// Gets or sets the version of the desired product/artifact. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Publisher == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); - } - if (Product == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Product"); - } - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolChangeRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolChangeRequest.cs index 6e528a73cec1..14eaf5b0b07f 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolChangeRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolChangeRequest.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,11 +23,13 @@ public PoolChangeRequest() /// /// Initializes a new instance of the PoolChangeRequest class. /// - /// Resource id of the pool to move - /// volume to + + /// Resource id of the pool to move volume to + /// public PoolChangeRequest(string newPoolResourceId) + { - NewPoolResourceId = newPoolResourceId; + this.NewPoolResourceId = newPoolResourceId; CustomInit(); } @@ -43,24 +38,25 @@ public PoolChangeRequest(string newPoolResourceId) /// partial void CustomInit(); + /// /// Gets or sets resource id of the pool to move volume to /// - [JsonProperty(PropertyName = "newPoolResourceId")] - public string NewPoolResourceId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "newPoolResourceId")] + public string NewPoolResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (NewPoolResourceId == null) + if (this.NewPoolResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "NewPoolResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "NewPoolResourceId"); } + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolPatchProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolPatchProperties.cs new file mode 100644 index 000000000000..ca1d78b6bd77 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolPatchProperties.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.NetApp.Models +{ + using System.Linq; + + /// + /// Patchable pool properties + /// + public partial class PoolPatchProperties + { + /// + /// Initializes a new instance of the PoolPatchProperties class. + /// + public PoolPatchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PoolPatchProperties class. + /// + + /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks + /// (value must be multiply of 4398046511104). + /// + + /// The qos type of the pool + /// Possible values include: 'Auto', 'Manual' + + /// If enabled (true) the pool can contain cool Access enabled volumes. + /// + public PoolPatchProperties(long? size = default(long?), string qosType = default(string), bool? coolAccess = default(bool?)) + + { + this.Size = size; + this.QosType = qosType; + this.CoolAccess = coolAccess; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets provisioned size of the pool (in bytes). Allowed values are in + /// 1TiB chunks (value must be multiply of 4398046511104). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public long? Size {get; set; } + + /// + /// Gets or sets the qos type of the pool Possible values include: 'Auto', 'Manual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "qosType")] + public string QosType {get; set; } + + /// + /// Gets or sets if enabled (true) the pool can contain cool Access enabled + /// volumes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coolAccess")] + public bool? CoolAccess {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolProperties.cs new file mode 100644 index 000000000000..fd5692932f50 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/PoolProperties.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Pool properties + /// + public partial class PoolProperties + { + /// + /// Initializes a new instance of the PoolProperties class. + /// + public PoolProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PoolProperties class. + /// + + /// UUID v4 used to identify the Pool + /// + + /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks + /// (value must be multiply of 4398046511104). + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// Azure lifecycle management + /// + + /// Total throughput of pool in MiB/s + /// + + /// Utilized throughput of pool in MiB/s + /// + + /// The qos type of the pool + /// Possible values include: 'Auto', 'Manual' + + /// If enabled (true) the pool can contain cool Access enabled volumes. + /// + + /// Encryption type of the capacity pool, set encryption type for data at rest + /// for this pool and all volumes in it. This value can only be set when + /// creating new pool. + /// Possible values include: 'Single', 'Double' + public PoolProperties(long size, string serviceLevel, string poolId = default(string), string provisioningState = default(string), double? totalThroughputMibps = default(double?), double? utilizedThroughputMibps = default(double?), string qosType = default(string), bool? coolAccess = default(bool?), string encryptionType = default(string)) + + { + this.PoolId = poolId; + this.Size = size; + this.ServiceLevel = serviceLevel; + this.ProvisioningState = provisioningState; + this.TotalThroughputMibps = totalThroughputMibps; + this.UtilizedThroughputMibps = utilizedThroughputMibps; + this.QosType = qosType; + this.CoolAccess = coolAccess; + this.EncryptionType = encryptionType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets uUID v4 used to identify the Pool + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "poolId")] + public string PoolId {get; private set; } + + /// + /// Gets or sets provisioned size of the pool (in bytes). Allowed values are in + /// 1TiB chunks (value must be multiply of 4398046511104). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public long Size {get; set; } + + /// + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceLevel")] + public string ServiceLevel {get; set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets total throughput of pool in MiB/s + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "totalThroughputMibps")] + public double? TotalThroughputMibps {get; private set; } + + /// + /// Gets utilized throughput of pool in MiB/s + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "utilizedThroughputMibps")] + public double? UtilizedThroughputMibps {get; private set; } + + /// + /// Gets or sets the qos type of the pool Possible values include: 'Auto', 'Manual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "qosType")] + public string QosType {get; set; } + + /// + /// Gets or sets if enabled (true) the pool can contain cool Access enabled + /// volumes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coolAccess")] + public bool? CoolAccess {get; set; } + + /// + /// Gets or sets encryption type of the capacity pool, set encryption type for + /// data at rest for this pool and all volumes in it. This value can only be + /// set when creating new pool. Possible values include: 'Single', 'Double' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionType")] + public string EncryptionType {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ServiceLevel == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ServiceLevel"); + } + if (this.PoolId != null) + { + if (this.PoolId.Length > 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "PoolId", 36); + } + if (this.PoolId.Length < 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "PoolId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(this.PoolId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "PoolId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } + + + + + } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProvisioningState.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProvisioningState.cs index 4f74a3c0e062..c3ed7091535c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProvisioningState.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProvisioningState.cs @@ -1,39 +1,32 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for ProvisioningState. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ProvisioningState { - [EnumMember(Value = "Accepted")] + [System.Runtime.Serialization.EnumMember(Value = "Accepted")] Accepted, - [EnumMember(Value = "Creating")] + [System.Runtime.Serialization.EnumMember(Value = "Creating")] Creating, - [EnumMember(Value = "Patching")] + [System.Runtime.Serialization.EnumMember(Value = "Patching")] Patching, - [EnumMember(Value = "Deleting")] + [System.Runtime.Serialization.EnumMember(Value = "Deleting")] Deleting, - [EnumMember(Value = "Moving")] + [System.Runtime.Serialization.EnumMember(Value = "Moving")] Moving, - [EnumMember(Value = "Failed")] + [System.Runtime.Serialization.EnumMember(Value = "Failed")] Failed, - [EnumMember(Value = "Succeeded")] + [System.Runtime.Serialization.EnumMember(Value = "Succeeded")] Succeeded } internal static class ProvisioningStateEnumExtension @@ -42,7 +35,6 @@ internal static string ToSerializedValue(this ProvisioningState? value) { return value == null ? null : ((ProvisioningState)value).ToSerializedValue(); } - internal static string ToSerializedValue(this ProvisioningState value) { switch( value ) @@ -64,7 +56,6 @@ internal static string ToSerializedValue(this ProvisioningState value) } return null; } - internal static ProvisioningState? ParseProvisioningState(this string value) { switch( value ) @@ -87,4 +78,4 @@ internal static string ToSerializedValue(this ProvisioningState value) return null; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProxyResource.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProxyResource.cs index e2a6dd01e7b5..0ed452caebd1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProxyResource.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ProxyResource.cs @@ -1,23 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { using System.Linq; /// - /// Proxy Resource + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location /// /// - /// The resource model definition for a Azure Resource Manager proxy - /// resource. It will not have tags and a location + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location /// public partial class ProxyResource : Resource { @@ -32,16 +28,24 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, systemData) + + : base(id, name, type, systemData) { CustomInit(); } @@ -52,4 +56,4 @@ public ProxyResource() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QosType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QosType.cs index c51d7fc9830f..862bbca84619 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QosType.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QosType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for QosType. /// + + public static class QosType { /// @@ -25,4 +22,4 @@ public static class QosType /// public const string Manual = "Manual"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QuotaAvailabilityRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QuotaAvailabilityRequest.cs index 350a0a4ad99a..d4ed8163b8e8 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QuotaAvailabilityRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/QuotaAvailabilityRequest.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,18 +23,24 @@ public QuotaAvailabilityRequest() /// /// Initializes a new instance of the QuotaAvailabilityRequest class. /// - /// Name of the resource to verify. - /// Resource type used for verification. Possible - /// values include: 'Microsoft.NetApp/netAppAccounts', + + /// Name of the resource to verify. + /// + + /// Resource type used for verification. + /// Possible values include: 'Microsoft.NetApp/netAppAccounts', /// 'Microsoft.NetApp/netAppAccounts/capacityPools', /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' - /// Resource group name. + + /// Resource group name. + /// public QuotaAvailabilityRequest(string name, string type, string resourceGroup) + { - Name = name; - Type = type; - ResourceGroup = resourceGroup; + this.Name = name; + this.Type = type; + this.ResourceGroup = resourceGroup; CustomInit(); } @@ -50,48 +49,47 @@ public QuotaAvailabilityRequest(string name, string type, string resourceGroup) /// partial void CustomInit(); + /// /// Gets or sets name of the resource to verify. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets resource type used for verification. Possible values - /// include: 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + /// Gets or sets resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets resource group name. /// - [JsonProperty(PropertyName = "resourceGroup")] - public string ResourceGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Type == null) + if (this.Type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); } - if (ResourceGroup == null) + if (this.ResourceGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ResourceGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceGroup"); } + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReestablishReplicationRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReestablishReplicationRequest.cs index 89378c1cf0af..c33aef489bc9 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReestablishReplicationRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReestablishReplicationRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.NetApp.Models public partial class ReestablishReplicationRequest { /// - /// Initializes a new instance of the ReestablishReplicationRequest - /// class. + /// Initializes a new instance of the ReestablishReplicationRequest class. /// public ReestablishReplicationRequest() { @@ -28,14 +21,15 @@ public ReestablishReplicationRequest() } /// - /// Initializes a new instance of the ReestablishReplicationRequest - /// class. + /// Initializes a new instance of the ReestablishReplicationRequest class. /// - /// Resource id of the source volume for - /// the replication + + /// Resource id of the source volume for the replication + /// public ReestablishReplicationRequest(string sourceVolumeId = default(string)) + { - SourceVolumeId = sourceVolumeId; + this.SourceVolumeId = sourceVolumeId; CustomInit(); } @@ -44,11 +38,11 @@ public ReestablishReplicationRequest() /// partial void CustomInit(); + /// /// Gets or sets resource id of the source volume for the replication /// - [JsonProperty(PropertyName = "sourceVolumeId")] - public string SourceVolumeId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceVolumeId")] + public string SourceVolumeId {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfo.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfo.cs index b88eeaef6266..33f54fa1cde2 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfo.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfo.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,19 @@ public RegionInfo() /// /// Initializes a new instance of the RegionInfo class. /// - /// Storage to Network - /// Proximity - /// Logical availability zone - /// mappings. - public RegionInfo(string storageToNetworkProximity = default(string), IList availabilityZoneMappings = default(IList)) + + /// Provides storage to network proximity information in the region. + /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2', 'T1AndT2', + /// 'T1AndAcrossT2', 'T2AndAcrossT2', 'T1AndT2AndAcrossT2' + + /// Provides logical availability zone mappings for the subscription for a + /// region. + /// + public RegionInfo(string storageToNetworkProximity = default(string), System.Collections.Generic.IList availabilityZoneMappings = default(System.Collections.Generic.IList)) + { - StorageToNetworkProximity = storageToNetworkProximity; - AvailabilityZoneMappings = availabilityZoneMappings; + this.StorageToNetworkProximity = storageToNetworkProximity; + this.AvailabilityZoneMappings = availabilityZoneMappings; CustomInit(); } @@ -47,26 +44,19 @@ public RegionInfo() /// partial void CustomInit(); + /// - /// Gets or sets storage to Network Proximity + /// Gets or sets provides storage to network proximity information in the + /// region. Possible values include: 'Default', 'T1', 'T2', 'AcrossT2', 'T1AndT2', 'T1AndAcrossT2', 'T2AndAcrossT2', 'T1AndT2AndAcrossT2' /// - /// - /// Provides storage to network proximity information in the region. - /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2', - /// 'T1AndT2', 'T1AndAcrossT2', 'T2AndAcrossT2', 'T1AndT2AndAcrossT2' - /// - [JsonProperty(PropertyName = "storageToNetworkProximity")] - public string StorageToNetworkProximity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "storageToNetworkProximity")] + public string StorageToNetworkProximity {get; set; } /// - /// Gets or sets logical availability zone mappings. + /// Gets or sets provides logical availability zone mappings for the + /// subscription for a region. /// - /// - /// Provides logical availability zone mappings for the subscription - /// for a region. - /// - [JsonProperty(PropertyName = "availabilityZoneMappings")] - public IList AvailabilityZoneMappings { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityZoneMappings")] + public System.Collections.Generic.IList AvailabilityZoneMappings {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs index 8708134fef71..07513a8eee4d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs @@ -1,23 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; public partial class RegionInfoAvailabilityZoneMappingsItem { /// - /// Initializes a new instance of the - /// RegionInfoAvailabilityZoneMappingsItem class. + /// Initializes a new instance of the RegionInfoAvailabilityZoneMappingsItem class. /// public RegionInfoAvailabilityZoneMappingsItem() { @@ -25,15 +18,19 @@ public RegionInfoAvailabilityZoneMappingsItem() } /// - /// Initializes a new instance of the - /// RegionInfoAvailabilityZoneMappingsItem class. + /// Initializes a new instance of the RegionInfoAvailabilityZoneMappingsItem class. /// - /// Logical availability zone. - /// Available availability zone + + /// Logical availability zone. + /// + + /// Available availability zone + /// public RegionInfoAvailabilityZoneMappingsItem(string availabilityZone = default(string), bool? isAvailable = default(bool?)) + { - AvailabilityZone = availabilityZone; - IsAvailable = isAvailable; + this.AvailabilityZone = availabilityZone; + this.IsAvailable = isAvailable; CustomInit(); } @@ -42,17 +39,17 @@ public RegionInfoAvailabilityZoneMappingsItem() /// partial void CustomInit(); + /// /// Gets or sets logical availability zone. /// - [JsonProperty(PropertyName = "availabilityZone")] - public string AvailabilityZone { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "availabilityZone")] + public string AvailabilityZone {get; set; } /// /// Gets or sets available availability zone /// - [JsonProperty(PropertyName = "isAvailable")] - public bool? IsAvailable { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isAvailable")] + public bool? IsAvailable {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionStorageToNetworkProximity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionStorageToNetworkProximity.cs index 20abd6f0fe8a..e8ddf48c4a70 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionStorageToNetworkProximity.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RegionStorageToNetworkProximity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for RegionStorageToNetworkProximity. /// + + public static class RegionStorageToNetworkProximity { /// @@ -49,4 +46,4 @@ public static class RegionStorageToNetworkProximity /// public const string T1AndT2AndAcrossT2 = "T1AndT2AndAcrossT2"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelationshipStatus.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelationshipStatus.cs index a1e88b95b48e..60a3f29b6341 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelationshipStatus.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelationshipStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for RelationshipStatus. /// + + public static class RelationshipStatus { public const string Idle = "Idle"; public const string Transferring = "Transferring"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelocateVolumeRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelocateVolumeRequest.cs index 7dc539761f1d..2b87dbeb3240 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelocateVolumeRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RelocateVolumeRequest.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public RelocateVolumeRequest() /// /// Initializes a new instance of the RelocateVolumeRequest class. /// - /// New creation token for the volume that - /// controls the mount point name + + /// New creation token for the volume that controls the mount point name + /// public RelocateVolumeRequest(string creationToken = default(string)) + { - CreationToken = creationToken; + this.CreationToken = creationToken; CustomInit(); } @@ -42,12 +38,12 @@ public RelocateVolumeRequest() /// partial void CustomInit(); + /// - /// Gets or sets new creation token for the volume that controls the - /// mount point name + /// Gets or sets new creation token for the volume that controls the mount + /// point name /// - [JsonProperty(PropertyName = "creationToken")] - public string CreationToken { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "creationToken")] + public string CreationToken {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Replication.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Replication.cs index 24031f63bbe3..ec88caf24c45 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Replication.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Replication.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,21 +23,26 @@ public Replication() /// /// Initializes a new instance of the Replication class. /// - /// The resource ID of the remote - /// volume. - /// Indicates whether the local volume is - /// the source or destination for the Volume Replication. Possible - /// values include: 'src', 'dst' - /// Schedule. Possible values - /// include: '_10minutely', 'hourly', 'daily' - /// The remote region for the other - /// end of the Volume Replication. + + /// Indicates whether the local volume is the source or destination for the + /// Volume Replication + /// Possible values include: 'src', 'dst' + + /// Schedule + /// Possible values include: '_10minutely', 'hourly', 'daily' + + /// The resource ID of the remote volume. + /// + + /// The remote region for the other end of the Volume Replication. + /// public Replication(string remoteVolumeResourceId, string endpointType = default(string), string replicationSchedule = default(string), string remoteVolumeRegion = default(string)) + { - EndpointType = endpointType; - ReplicationSchedule = replicationSchedule; - RemoteVolumeResourceId = remoteVolumeResourceId; - RemoteVolumeRegion = remoteVolumeRegion; + this.EndpointType = endpointType; + this.ReplicationSchedule = replicationSchedule; + this.RemoteVolumeResourceId = remoteVolumeResourceId; + this.RemoteVolumeRegion = remoteVolumeRegion; CustomInit(); } @@ -53,46 +51,47 @@ public Replication() /// partial void CustomInit(); + /// /// Gets or sets indicates whether the local volume is the source or - /// destination for the Volume Replication. Possible values include: - /// 'src', 'dst' + /// destination for the Volume Replication Possible values include: 'src', 'dst' /// - [JsonProperty(PropertyName = "endpointType")] - public string EndpointType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endpointType")] + public string EndpointType {get; set; } /// - /// Gets or sets schedule. Possible values include: '_10minutely', - /// 'hourly', 'daily' + /// Gets or sets schedule Possible values include: '_10minutely', 'hourly', 'daily' /// - [JsonProperty(PropertyName = "replicationSchedule")] - public string ReplicationSchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationSchedule")] + public string ReplicationSchedule {get; set; } /// /// Gets or sets the resource ID of the remote volume. /// - [JsonProperty(PropertyName = "remoteVolumeResourceId")] - public string RemoteVolumeResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVolumeResourceId")] + public string RemoteVolumeResourceId {get; set; } /// - /// Gets or sets the remote region for the other end of the Volume - /// Replication. + /// Gets or sets the remote region for the other end of the Volume Replication. /// - [JsonProperty(PropertyName = "remoteVolumeRegion")] - public string RemoteVolumeRegion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVolumeRegion")] + public string RemoteVolumeRegion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RemoteVolumeResourceId == null) + if (this.RemoteVolumeResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RemoteVolumeResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RemoteVolumeResourceId"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationObject.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationObject.cs index 24119a785e89..fb1b6c222891 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationObject.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationObject.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,23 +23,30 @@ public ReplicationObject() /// /// Initializes a new instance of the ReplicationObject class. /// - /// The resource ID of the remote - /// volume. - /// Id - /// Indicates whether the local volume is - /// the source or destination for the Volume Replication. Possible - /// values include: 'src', 'dst' - /// Schedule. Possible values - /// include: '_10minutely', 'hourly', 'daily' - /// The remote region for the other - /// end of the Volume Replication. + + /// Id + /// + + /// Indicates whether the local volume is the source or destination for the + /// Volume Replication + /// Possible values include: 'src', 'dst' + + /// Schedule + /// Possible values include: '_10minutely', 'hourly', 'daily' + + /// The resource ID of the remote volume. + /// + + /// The remote region for the other end of the Volume Replication. + /// public ReplicationObject(string remoteVolumeResourceId, string replicationId = default(string), string endpointType = default(string), string replicationSchedule = default(string), string remoteVolumeRegion = default(string)) + { - ReplicationId = replicationId; - EndpointType = endpointType; - ReplicationSchedule = replicationSchedule; - RemoteVolumeResourceId = remoteVolumeResourceId; - RemoteVolumeRegion = remoteVolumeRegion; + this.ReplicationId = replicationId; + this.EndpointType = endpointType; + this.ReplicationSchedule = replicationSchedule; + this.RemoteVolumeResourceId = remoteVolumeResourceId; + this.RemoteVolumeRegion = remoteVolumeRegion; CustomInit(); } @@ -55,52 +55,54 @@ public ReplicationObject() /// partial void CustomInit(); + /// /// Gets or sets id /// - [JsonProperty(PropertyName = "replicationId")] - public string ReplicationId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationId")] + public string ReplicationId {get; set; } /// /// Gets or sets indicates whether the local volume is the source or - /// destination for the Volume Replication. Possible values include: - /// 'src', 'dst' + /// destination for the Volume Replication Possible values include: 'src', 'dst' /// - [JsonProperty(PropertyName = "endpointType")] - public string EndpointType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endpointType")] + public string EndpointType {get; set; } /// - /// Gets or sets schedule. Possible values include: '_10minutely', - /// 'hourly', 'daily' + /// Gets or sets schedule Possible values include: '_10minutely', 'hourly', 'daily' /// - [JsonProperty(PropertyName = "replicationSchedule")] - public string ReplicationSchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "replicationSchedule")] + public string ReplicationSchedule {get; set; } /// /// Gets or sets the resource ID of the remote volume. /// - [JsonProperty(PropertyName = "remoteVolumeResourceId")] - public string RemoteVolumeResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVolumeResourceId")] + public string RemoteVolumeResourceId {get; set; } /// - /// Gets or sets the remote region for the other end of the Volume - /// Replication. + /// Gets or sets the remote region for the other end of the Volume Replication. /// - [JsonProperty(PropertyName = "remoteVolumeRegion")] - public string RemoteVolumeRegion { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "remoteVolumeRegion")] + public string RemoteVolumeRegion {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RemoteVolumeResourceId == null) + if (this.RemoteVolumeResourceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "RemoteVolumeResourceId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "RemoteVolumeResourceId"); } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationSchedule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationSchedule.cs index 9b81bd603a2a..e79e3a80c809 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationSchedule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationSchedule.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for ReplicationSchedule. /// + + public static class ReplicationSchedule { - public const string _10minutely = "_10minutely"; + public const string _10Minutely = "_10minutely"; public const string Hourly = "hourly"; public const string Daily = "daily"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationStatus.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationStatus.cs index 86159262d5bb..75176df31919 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationStatus.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ReplicationStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,21 +23,29 @@ public ReplicationStatus() /// /// Initializes a new instance of the ReplicationStatus class. /// - /// Replication health check - /// Status of the mirror relationship. + + /// Replication health check + /// + + /// Status of the mirror relationship /// Possible values include: 'Idle', 'Transferring' - /// The status of the replication. Possible - /// values include: 'Uninitialized', 'Mirrored', 'Broken' - /// The progress of the replication - /// Displays error message if the - /// replication is in an error state + + /// The status of the replication + /// Possible values include: 'Uninitialized', 'Mirrored', 'Broken' + + /// The progress of the replication + /// + + /// Displays error message if the replication is in an error state + /// public ReplicationStatus(bool? healthy = default(bool?), string relationshipStatus = default(string), string mirrorState = default(string), string totalProgress = default(string), string errorMessage = default(string)) + { - Healthy = healthy; - RelationshipStatus = relationshipStatus; - MirrorState = mirrorState; - TotalProgress = totalProgress; - ErrorMessage = errorMessage; + this.Healthy = healthy; + this.RelationshipStatus = relationshipStatus; + this.MirrorState = mirrorState; + this.TotalProgress = totalProgress; + this.ErrorMessage = errorMessage; CustomInit(); } @@ -52,38 +54,35 @@ public ReplicationStatus() /// partial void CustomInit(); + /// /// Gets or sets replication health check /// - [JsonProperty(PropertyName = "healthy")] - public bool? Healthy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "healthy")] + public bool? Healthy {get; set; } /// - /// Gets or sets status of the mirror relationship. Possible values - /// include: 'Idle', 'Transferring' + /// Gets or sets status of the mirror relationship Possible values include: 'Idle', 'Transferring' /// - [JsonProperty(PropertyName = "relationshipStatus")] - public string RelationshipStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "relationshipStatus")] + public string RelationshipStatus {get; set; } /// - /// Gets or sets the status of the replication. Possible values - /// include: 'Uninitialized', 'Mirrored', 'Broken' + /// Gets or sets the status of the replication Possible values include: 'Uninitialized', 'Mirrored', 'Broken' /// - [JsonProperty(PropertyName = "mirrorState")] - public string MirrorState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mirrorState")] + public string MirrorState {get; set; } /// /// Gets or sets the progress of the replication /// - [JsonProperty(PropertyName = "totalProgress")] - public string TotalProgress { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "totalProgress")] + public string TotalProgress {get; set; } /// - /// Gets or sets displays error message if the replication is in an - /// error state + /// Gets or sets displays error message if the replication is in an error state /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Resource.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Resource.cs index 396ba16afb66..5f74657b1102 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Resource.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Resource.cs @@ -1,28 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// - /// Resource + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources /// /// /// Common fields that are returned in the response for all Azure Resource /// Manager resources /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -35,20 +28,28 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + { - Id = id; - Name = name; - Type = type; - SystemData = systemData; + this.Id = id; + this.Name = name; + this.Type = type; + this.SystemData = systemData; CustomInit(); } @@ -57,33 +58,32 @@ public Resource() /// partial void CustomInit(); + /// /// Gets fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the name of the resource /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" + /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets azure Resource Manager metadata containing createdBy and - /// modifiedBy information. + /// Gets azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentity.cs index cc4df6e13c3f..25904edb86c0 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentity.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentity.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public ResourceIdentity() /// /// Initializes a new instance of the ResourceIdentity class. /// - /// Object id of the identity - /// resource - /// The tenant id of the resource - /// Type of Identity. Supported values are: 'None', - /// 'SystemAssigned' + + /// Object id of the identity resource + /// + + /// The tenant id of the resource + /// + + /// Type of Identity. Supported values are: 'None', 'SystemAssigned' + /// public ResourceIdentity(string principalId = default(string), string tenantId = default(string), string type = default(string)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; CustomInit(); } @@ -47,24 +46,24 @@ public ResourceIdentity() /// partial void CustomInit(); + /// /// Gets object id of the identity resource /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets the tenant id of the resource /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// - /// Gets or sets type of Identity. Supported values are: 'None', - /// 'SystemAssigned' + /// Gets or sets type of Identity. Supported values are: 'None', + /// 'SystemAssigned' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentityType.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentityType.cs deleted file mode 100644 index 8ad5f78b4195..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceIdentityType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ResourceIdentityType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ResourceIdentityType - { - [EnumMember(Value = "SystemAssigned")] - SystemAssigned - } - internal static class ResourceIdentityTypeEnumExtension - { - internal static string ToSerializedValue(this ResourceIdentityType? value) - { - return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ResourceIdentityType value) - { - switch( value ) - { - case ResourceIdentityType.SystemAssigned: - return "SystemAssigned"; - } - return null; - } - - internal static ResourceIdentityType? ParseResourceIdentityType(this string value) - { - switch( value ) - { - case "SystemAssigned": - return ResourceIdentityType.SystemAssigned; - } - return null; - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySet.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySet.cs deleted file mode 100644 index 5747ed9068d1..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySet.cs +++ /dev/null @@ -1,141 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The resource model definition containing the full set of allowed - /// properties for a resource. Except properties bag, there cannot be a top - /// level property outside of this set. - /// - public partial class ResourceModelWithAllowedPropertySet : IResource - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySet class. - /// - public ResourceModelWithAllowedPropertySet() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySet class. - /// - /// The fully qualified resource ID of the - /// resource that manages this resource. Indicates if this resource is - /// managed by another Azure resource. If this is present, complete - /// mode deployment will not delete the resource if it is removed from - /// the template since it is managed by another resource. - /// Metadata used by portal/tooling/etc to render - /// different UX experiences for resources of the same type; e.g. - /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the - /// resource provider must validate and persist this value. - /// The etag field is *not* required. If it is - /// provided in the response body, it must also be provided as a header - /// per the normal etag convention. Entity tags are used for comparing - /// two or more entities from the same requested resource. HTTP/1.1 - /// uses entity tags in the etag (section 14.19), If-Match (section - /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) - /// header fields. - public ResourceModelWithAllowedPropertySet(string managedBy = default(string), string kind = default(string), string etag = default(string), ResourceModelWithAllowedPropertySetIdentity identity = default(ResourceModelWithAllowedPropertySetIdentity), ResourceModelWithAllowedPropertySetSku sku = default(ResourceModelWithAllowedPropertySetSku), ResourceModelWithAllowedPropertySetPlan plan = default(ResourceModelWithAllowedPropertySetPlan)) - { - ManagedBy = managedBy; - Kind = kind; - Etag = etag; - Identity = identity; - Sku = sku; - Plan = plan; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the fully qualified resource ID of the resource that - /// manages this resource. Indicates if this resource is managed by - /// another Azure resource. If this is present, complete mode - /// deployment will not delete the resource if it is removed from the - /// template since it is managed by another resource. - /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; set; } - - /// - /// Gets or sets metadata used by portal/tooling/etc to render - /// different UX experiences for resources of the same type; e.g. - /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the - /// resource provider must validate and persist this value. - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets the etag field is *not* required. If it is provided in the - /// response body, it must also be provided as a header per the normal - /// etag convention. Entity tags are used for comparing two or more - /// entities from the same requested resource. HTTP/1.1 uses entity - /// tags in the etag (section 14.19), If-Match (section 14.24), - /// If-None-Match (section 14.26), and If-Range (section 14.27) header - /// fields. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "identity")] - public ResourceModelWithAllowedPropertySetIdentity Identity { get; set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public ResourceModelWithAllowedPropertySetSku Sku { get; set; } - - /// - /// - [JsonProperty(PropertyName = "plan")] - public ResourceModelWithAllowedPropertySetPlan Plan { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Kind != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); - } - } - if (Sku != null) - { - Sku.Validate(); - } - if (Plan != null) - { - Plan.Validate(); - } - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs deleted file mode 100644 index 4efca41b00c0..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using System.Linq; - - public partial class ResourceModelWithAllowedPropertySetIdentity : Identity - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetIdentity class. - /// - public ResourceModelWithAllowedPropertySetIdentity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetIdentity class. - /// - /// The principal ID of resource - /// identity. - /// The tenant ID of resource. - /// The identity type. Possible values include: - /// 'SystemAssigned' - public ResourceModelWithAllowedPropertySetIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) - : base(principalId, tenantId, type) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs deleted file mode 100644 index 66f4925b6486..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using System.Linq; - - public partial class ResourceModelWithAllowedPropertySetPlan : Plan - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetPlan class. - /// - public ResourceModelWithAllowedPropertySetPlan() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetPlan class. - /// - /// A user defined name of the 3rd Party Artifact - /// that is being procured. - /// The publisher of the 3rd Party Artifact - /// that is being bought. E.g. NewRelic - /// The 3rd Party artifact that is being - /// procured. E.g. NewRelic. Product maps to the OfferID specified for - /// the artifact at the time of Data Market onboarding. - /// A publisher provided promotion code as - /// provisioned in Data Market for the said product/artifact. - /// The version of the desired - /// product/artifact. - public ResourceModelWithAllowedPropertySetPlan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) - : base(name, publisher, product, promotionCode, version) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs deleted file mode 100644 index 5b5a9d86f2b6..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using System.Linq; - - public partial class ResourceModelWithAllowedPropertySetSku : Sku - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetSku class. - /// - public ResourceModelWithAllowedPropertySetSku() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetSku class. - /// - /// The name of the SKU. Ex - P3. It is typically a - /// letter+number code - /// Possible values include: 'Free', 'Basic', - /// 'Standard', 'Premium' - /// The SKU size. When the name field is the - /// combination of tier and some other value, this would be the - /// standalone code. - /// If the service has different generations of - /// hardware, for the same SKU, then that can be captured here. - /// If the SKU supports scale out/in then the - /// capacity integer should be included. If scale out/in is not - /// possible for the resource this may be omitted. - public ResourceModelWithAllowedPropertySetSku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) - : base(name, tier, size, family, capacity) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceNameAvailabilityRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceNameAvailabilityRequest.cs index 7a776ee136a6..db0e7c86648f 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceNameAvailabilityRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ResourceNameAvailabilityRequest.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.NetApp.Models public partial class ResourceNameAvailabilityRequest { /// - /// Initializes a new instance of the ResourceNameAvailabilityRequest - /// class. + /// Initializes a new instance of the ResourceNameAvailabilityRequest class. /// public ResourceNameAvailabilityRequest() { @@ -29,21 +21,26 @@ public ResourceNameAvailabilityRequest() } /// - /// Initializes a new instance of the ResourceNameAvailabilityRequest - /// class. + /// Initializes a new instance of the ResourceNameAvailabilityRequest class. /// - /// Resource name to verify. - /// Resource type used for verification. Possible - /// values include: 'Microsoft.NetApp/netAppAccounts', + + /// Resource name to verify. + /// + + /// Resource type used for verification. + /// Possible values include: 'Microsoft.NetApp/netAppAccounts', /// 'Microsoft.NetApp/netAppAccounts/capacityPools', /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' - /// Resource group name. + + /// Resource group name. + /// public ResourceNameAvailabilityRequest(string name, string type, string resourceGroup) + { - Name = name; - Type = type; - ResourceGroup = resourceGroup; + this.Name = name; + this.Type = type; + this.ResourceGroup = resourceGroup; CustomInit(); } @@ -52,48 +49,47 @@ public ResourceNameAvailabilityRequest(string name, string type, string resource /// partial void CustomInit(); + /// /// Gets or sets resource name to verify. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets resource type used for verification. Possible values - /// include: 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + /// Gets or sets resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// /// Gets or sets resource group name. /// - [JsonProperty(PropertyName = "resourceGroup")] - public string ResourceGroup { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Type == null) + if (this.Type == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Type"); } - if (ResourceGroup == null) + if (this.ResourceGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ResourceGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceGroup"); } + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RestoreStatus.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RestoreStatus.cs index 0f1439038025..3c4a10043d7e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RestoreStatus.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/RestoreStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,26 +23,33 @@ public RestoreStatus() /// /// Initializes a new instance of the RestoreStatus class. /// - /// Restore health status - /// Status of the restore SnapMirror - /// relationship. Possible values include: 'Idle', - /// 'Transferring' - /// The status of the restore. Possible - /// values include: 'Uninitialized', 'Mirrored', 'Broken' - /// Reason for the unhealthy restore - /// relationship - /// Displays error message if the restore is - /// in an error state - /// Displays the total bytes - /// transferred + + /// Restore health status + /// + + /// Status of the restore SnapMirror relationship + /// Possible values include: 'Idle', 'Transferring' + + /// The status of the restore + /// Possible values include: 'Uninitialized', 'Mirrored', 'Broken' + + /// Reason for the unhealthy restore relationship + /// + + /// Displays error message if the restore is in an error state + /// + + /// Displays the total bytes transferred + /// public RestoreStatus(bool? healthy = default(bool?), string relationshipStatus = default(string), string mirrorState = default(string), string unhealthyReason = default(string), string errorMessage = default(string), long? totalTransferBytes = default(long?)) + { - Healthy = healthy; - RelationshipStatus = relationshipStatus; - MirrorState = mirrorState; - UnhealthyReason = unhealthyReason; - ErrorMessage = errorMessage; - TotalTransferBytes = totalTransferBytes; + this.Healthy = healthy; + this.RelationshipStatus = relationshipStatus; + this.MirrorState = mirrorState; + this.UnhealthyReason = unhealthyReason; + this.ErrorMessage = errorMessage; + this.TotalTransferBytes = totalTransferBytes; CustomInit(); } @@ -57,43 +58,41 @@ public RestoreStatus() /// partial void CustomInit(); + /// /// Gets restore health status /// - [JsonProperty(PropertyName = "healthy")] - public bool? Healthy { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "healthy")] + public bool? Healthy {get; private set; } /// - /// Gets status of the restore SnapMirror relationship. Possible values - /// include: 'Idle', 'Transferring' + /// Gets status of the restore SnapMirror relationship Possible values include: 'Idle', 'Transferring' /// - [JsonProperty(PropertyName = "relationshipStatus")] - public string RelationshipStatus { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "relationshipStatus")] + public string RelationshipStatus {get; private set; } /// - /// Gets the status of the restore. Possible values include: - /// 'Uninitialized', 'Mirrored', 'Broken' + /// Gets the status of the restore Possible values include: 'Uninitialized', 'Mirrored', 'Broken' /// - [JsonProperty(PropertyName = "mirrorState")] - public string MirrorState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "mirrorState")] + public string MirrorState {get; private set; } /// /// Gets reason for the unhealthy restore relationship /// - [JsonProperty(PropertyName = "unhealthyReason")] - public string UnhealthyReason { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unhealthyReason")] + public string UnhealthyReason {get; private set; } /// /// Gets displays error message if the restore is in an error state /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage {get; private set; } /// /// Gets displays the total bytes transferred /// - [JsonProperty(PropertyName = "totalTransferBytes")] - public long? TotalTransferBytes { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "totalTransferBytes")] + public long? TotalTransferBytes {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SecurityStyle.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SecurityStyle.cs index 415dab71a1f0..28dcad68b5d4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SecurityStyle.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SecurityStyle.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for SecurityStyle. /// + + public static class SecurityStyle { public const string Ntfs = "ntfs"; public const string Unix = "unix"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceLevel.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceLevel.cs index ff8ebb82c26d..bbf47b19d07a 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceLevel.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceLevel.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for ServiceLevel. /// + + public static class ServiceLevel { /// @@ -33,4 +30,4 @@ public static class ServiceLevel /// public const string StandardZRS = "StandardZRS"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceSpecification.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceSpecification.cs index d8e7c8443912..4c083ad2fc82 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceSpecification.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/ServiceSpecification.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,14 +23,17 @@ public ServiceSpecification() /// /// Initializes a new instance of the ServiceSpecification class. /// - /// Metric specifications of - /// operation. - /// Log specification of - /// operation. - public ServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) + + /// Metric specifications of operation. + /// + + /// Log specification of operation. + /// + public ServiceSpecification(System.Collections.Generic.IList metricSpecifications = default(System.Collections.Generic.IList), System.Collections.Generic.IList logSpecifications = default(System.Collections.Generic.IList)) + { - MetricSpecifications = metricSpecifications; - LogSpecifications = logSpecifications; + this.MetricSpecifications = metricSpecifications; + this.LogSpecifications = logSpecifications; CustomInit(); } @@ -47,17 +42,17 @@ public ServiceSpecification() /// partial void CustomInit(); + /// /// Gets or sets metric specifications of operation. /// - [JsonProperty(PropertyName = "metricSpecifications")] - public IList MetricSpecifications { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "metricSpecifications")] + public System.Collections.Generic.IList MetricSpecifications {get; set; } /// /// Gets or sets log specification of operation. /// - [JsonProperty(PropertyName = "logSpecifications")] - public IList LogSpecifications { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "logSpecifications")] + public System.Collections.Generic.IList LogSpecifications {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Sku.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Sku.cs deleted file mode 100644 index 266ecc344638..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Sku.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The resource model definition representing SKU - /// - public partial class Sku - { - /// - /// Initializes a new instance of the Sku class. - /// - public Sku() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Sku class. - /// - /// The name of the SKU. Ex - P3. It is typically a - /// letter+number code - /// Possible values include: 'Free', 'Basic', - /// 'Standard', 'Premium' - /// The SKU size. When the name field is the - /// combination of tier and some other value, this would be the - /// standalone code. - /// If the service has different generations of - /// hardware, for the same SKU, then that can be captured here. - /// If the SKU supports scale out/in then the - /// capacity integer should be included. If scale out/in is not - /// possible for the resource this may be omitted. - public Sku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) - { - Name = name; - Tier = tier; - Size = size; - Family = family; - Capacity = capacity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the SKU. Ex - P3. It is typically a - /// letter+number code - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets possible values include: 'Free', 'Basic', 'Standard', - /// 'Premium' - /// - [JsonProperty(PropertyName = "tier")] - public SkuTier? Tier { get; set; } - - /// - /// Gets or sets the SKU size. When the name field is the combination - /// of tier and some other value, this would be the standalone code. - /// - [JsonProperty(PropertyName = "size")] - public string Size { get; set; } - - /// - /// Gets or sets if the service has different generations of hardware, - /// for the same SKU, then that can be captured here. - /// - [JsonProperty(PropertyName = "family")] - public string Family { get; set; } - - /// - /// Gets or sets if the SKU supports scale out/in then the capacity - /// integer should be included. If scale out/in is not possible for the - /// resource this may be omitted. - /// - [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SkuTier.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SkuTier.cs deleted file mode 100644 index b134517f7632..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SkuTier.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SkuTier. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum SkuTier - { - [EnumMember(Value = "Free")] - Free, - [EnumMember(Value = "Basic")] - Basic, - [EnumMember(Value = "Standard")] - Standard, - [EnumMember(Value = "Premium")] - Premium - } - internal static class SkuTierEnumExtension - { - internal static string ToSerializedValue(this SkuTier? value) - { - return value == null ? null : ((SkuTier)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SkuTier value) - { - switch( value ) - { - case SkuTier.Free: - return "Free"; - case SkuTier.Basic: - return "Basic"; - case SkuTier.Standard: - return "Standard"; - case SkuTier.Premium: - return "Premium"; - } - return null; - } - - internal static SkuTier? ParseSkuTier(this string value) - { - switch( value ) - { - case "Free": - return SkuTier.Free; - case "Basic": - return SkuTier.Basic; - case "Standard": - return SkuTier.Standard; - case "Premium": - return SkuTier.Premium; - } - return null; - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbAccessBasedEnumeration.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbAccessBasedEnumeration.cs index 5626bcb73c8e..c7590a270a0e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbAccessBasedEnumeration.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbAccessBasedEnumeration.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for SmbAccessBasedEnumeration. /// + + public static class SmbAccessBasedEnumeration { /// @@ -25,4 +22,4 @@ public static class SmbAccessBasedEnumeration /// public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbNonBrowsable.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbNonBrowsable.cs index 592ed0746d7a..ef6794c0106c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbNonBrowsable.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SmbNonBrowsable.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for SmbNonBrowsable. /// + + public static class SmbNonBrowsable { /// @@ -25,4 +22,4 @@ public static class SmbNonBrowsable /// public const string Enabled = "Enabled"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Snapshot.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Snapshot.cs index 19159d88a873..afe7bb009975 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Snapshot.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Snapshot.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Snapshot of a Volume /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Snapshot : ProxyResource { /// @@ -32,25 +24,41 @@ public Snapshot() /// /// Initializes a new instance of the Snapshot class. /// - /// Resource location + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// snapshotId - /// name - /// Azure lifecycle management + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource location + /// + + /// UUID v4 used to identify the Snapshot + /// + + /// The creation date of the snapshot + /// + + /// Azure lifecycle management + /// public Snapshot(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string snapshotId = default(string), System.DateTime? created = default(System.DateTime?), string provisioningState = default(string)) - : base(id, name, type, systemData) + + : base(id, name, type, systemData) { - Location = location; - SnapshotId = snapshotId; - Created = created; - ProvisioningState = provisioningState; + this.Location = location; + this.SnapshotId = snapshotId; + this.Created = created; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -59,63 +67,59 @@ public Snapshot() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets snapshotId + /// Gets uUID v4 used to identify the Snapshot /// - /// - /// UUID v4 used to identify the Snapshot - /// - [JsonProperty(PropertyName = "properties.snapshotId")] - public string SnapshotId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotId")] + public string SnapshotId {get; private set; } /// - /// Gets name + /// Gets the creation date of the snapshot /// - /// - /// The creation date of the snapshot - /// - [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.created")] + public System.DateTime? Created {get; private set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } - if (SnapshotId != null) + + if (this.SnapshotId != null) { - if (SnapshotId.Length > 36) + if (this.SnapshotId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "SnapshotId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "SnapshotId", 36); } - if (SnapshotId.Length < 36) + if (this.SnapshotId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "SnapshotId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "SnapshotId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(SnapshotId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.SnapshotId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "SnapshotId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "SnapshotId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicy.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicy.cs index d1cd63de5d99..51da50df9c05 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicy.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicy.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Snapshot policy information /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SnapshotPolicy : TrackedResource { /// @@ -34,36 +24,59 @@ public SnapshotPolicy() /// /// Initializes a new instance of the SnapshotPolicy class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// hourlySchedule - /// dailySchedule - /// weeklySchedule - /// monthlySchedule - /// The property to decide policy is enabled or - /// not - /// Azure lifecycle management - public SnapshotPolicy(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) - : base(location, id, name, type, systemData, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Schedule for hourly snapshots + /// + + /// Schedule for daily snapshots + /// + + /// Schedule for weekly snapshots + /// + + /// Schedule for monthly snapshots + /// + + /// The property to decide policy is enabled or not + /// + + /// Azure lifecycle management + /// + public SnapshotPolicy(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + + : base(location, id, name, type, systemData, tags) { - Etag = etag; - HourlySchedule = hourlySchedule; - DailySchedule = dailySchedule; - WeeklySchedule = weeklySchedule; - MonthlySchedule = monthlySchedule; - Enabled = enabled; - ProvisioningState = provisioningState; + this.Etag = etag; + this.HourlySchedule = hourlySchedule; + this.DailySchedule = dailySchedule; + this.WeeklySchedule = weeklySchedule; + this.MonthlySchedule = monthlySchedule; + this.Enabled = enabled; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -72,70 +85,64 @@ public SnapshotPolicy() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// - /// Gets or sets hourlySchedule + /// Gets or sets schedule for hourly snapshots /// - /// - /// Schedule for hourly snapshots - /// - [JsonProperty(PropertyName = "properties.hourlySchedule")] - public HourlySchedule HourlySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hourlySchedule")] + public HourlySchedule HourlySchedule {get; set; } /// - /// Gets or sets dailySchedule + /// Gets or sets schedule for daily snapshots /// - /// - /// Schedule for daily snapshots - /// - [JsonProperty(PropertyName = "properties.dailySchedule")] - public DailySchedule DailySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailySchedule")] + public DailySchedule DailySchedule {get; set; } /// - /// Gets or sets weeklySchedule + /// Gets or sets schedule for weekly snapshots /// - /// - /// Schedule for weekly snapshots - /// - [JsonProperty(PropertyName = "properties.weeklySchedule")] - public WeeklySchedule WeeklySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklySchedule")] + public WeeklySchedule WeeklySchedule {get; set; } /// - /// Gets or sets monthlySchedule + /// Gets or sets schedule for monthly snapshots /// - /// - /// Schedule for monthly snapshots - /// - [JsonProperty(PropertyName = "properties.monthlySchedule")] - public MonthlySchedule MonthlySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monthlySchedule")] + public MonthlySchedule MonthlySchedule {get; set; } /// /// Gets or sets the property to decide policy is enabled or not /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyDetails.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyDetails.cs index 05109a922cf2..121ca76d416b 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyDetails.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyDetails.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Snapshot policy properties /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SnapshotPolicyDetails { /// @@ -34,31 +24,53 @@ public SnapshotPolicyDetails() /// /// Initializes a new instance of the SnapshotPolicyDetails class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// hourlySchedule - /// dailySchedule - /// weeklySchedule - /// monthlySchedule - /// The property to decide policy is enabled or - /// not - /// Azure lifecycle management - public SnapshotPolicyDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// Schedule for hourly snapshots + /// + + /// Schedule for daily snapshots + /// + + /// Schedule for weekly snapshots + /// + + /// Schedule for monthly snapshots + /// + + /// The property to decide policy is enabled or not + /// + + /// Azure lifecycle management + /// + public SnapshotPolicyDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - HourlySchedule = hourlySchedule; - DailySchedule = dailySchedule; - WeeklySchedule = weeklySchedule; - MonthlySchedule = monthlySchedule; - Enabled = enabled; - ProvisioningState = provisioningState; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.HourlySchedule = hourlySchedule; + this.DailySchedule = dailySchedule; + this.WeeklySchedule = weeklySchedule; + this.MonthlySchedule = monthlySchedule; + this.Enabled = enabled; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -67,83 +79,71 @@ public SnapshotPolicyDetails() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets hourlySchedule + /// Gets or sets schedule for hourly snapshots /// - /// - /// Schedule for hourly snapshots - /// - [JsonProperty(PropertyName = "properties.hourlySchedule")] - public HourlySchedule HourlySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hourlySchedule")] + public HourlySchedule HourlySchedule {get; set; } /// - /// Gets or sets dailySchedule + /// Gets or sets schedule for daily snapshots /// - /// - /// Schedule for daily snapshots - /// - [JsonProperty(PropertyName = "properties.dailySchedule")] - public DailySchedule DailySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailySchedule")] + public DailySchedule DailySchedule {get; set; } /// - /// Gets or sets weeklySchedule + /// Gets or sets schedule for weekly snapshots /// - /// - /// Schedule for weekly snapshots - /// - [JsonProperty(PropertyName = "properties.weeklySchedule")] - public WeeklySchedule WeeklySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklySchedule")] + public WeeklySchedule WeeklySchedule {get; set; } /// - /// Gets or sets monthlySchedule + /// Gets or sets schedule for monthly snapshots /// - /// - /// Schedule for monthly snapshots - /// - [JsonProperty(PropertyName = "properties.monthlySchedule")] - public MonthlySchedule MonthlySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monthlySchedule")] + public MonthlySchedule MonthlySchedule {get; set; } /// /// Gets or sets the property to decide policy is enabled or not /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyPatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyPatch.cs index 165f145dccd6..6da1fc620f12 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyPatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyPatch.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Snapshot policy Details for create and update /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SnapshotPolicyPatch { /// @@ -34,31 +24,53 @@ public SnapshotPolicyPatch() /// /// Initializes a new instance of the SnapshotPolicyPatch class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// hourlySchedule - /// dailySchedule - /// weeklySchedule - /// monthlySchedule - /// The property to decide policy is enabled or - /// not - /// Azure lifecycle management - public SnapshotPolicyPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// Schedule for hourly snapshots + /// + + /// Schedule for daily snapshots + /// + + /// Schedule for weekly snapshots + /// + + /// Schedule for monthly snapshots + /// + + /// The property to decide policy is enabled or not + /// + + /// Azure lifecycle management + /// + public SnapshotPolicyPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - HourlySchedule = hourlySchedule; - DailySchedule = dailySchedule; - WeeklySchedule = weeklySchedule; - MonthlySchedule = monthlySchedule; - Enabled = enabled; - ProvisioningState = provisioningState; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.HourlySchedule = hourlySchedule; + this.DailySchedule = dailySchedule; + this.WeeklySchedule = weeklySchedule; + this.MonthlySchedule = monthlySchedule; + this.Enabled = enabled; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -67,83 +79,71 @@ public SnapshotPolicyPatch() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets hourlySchedule + /// Gets or sets schedule for hourly snapshots /// - /// - /// Schedule for hourly snapshots - /// - [JsonProperty(PropertyName = "properties.hourlySchedule")] - public HourlySchedule HourlySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.hourlySchedule")] + public HourlySchedule HourlySchedule {get; set; } /// - /// Gets or sets dailySchedule + /// Gets or sets schedule for daily snapshots /// - /// - /// Schedule for daily snapshots - /// - [JsonProperty(PropertyName = "properties.dailySchedule")] - public DailySchedule DailySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dailySchedule")] + public DailySchedule DailySchedule {get; set; } /// - /// Gets or sets weeklySchedule + /// Gets or sets schedule for weekly snapshots /// - /// - /// Schedule for weekly snapshots - /// - [JsonProperty(PropertyName = "properties.weeklySchedule")] - public WeeklySchedule WeeklySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.weeklySchedule")] + public WeeklySchedule WeeklySchedule {get; set; } /// - /// Gets or sets monthlySchedule + /// Gets or sets schedule for monthly snapshots /// - /// - /// Schedule for monthly snapshots - /// - [JsonProperty(PropertyName = "properties.monthlySchedule")] - public MonthlySchedule MonthlySchedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monthlySchedule")] + public MonthlySchedule MonthlySchedule {get; set; } /// /// Gets or sets the property to decide policy is enabled or not /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyProperties.cs new file mode 100644 index 000000000000..3dec46f7d9e0 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyProperties.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Snapshot policy properties + /// + public partial class SnapshotPolicyProperties + { + /// + /// Initializes a new instance of the SnapshotPolicyProperties class. + /// + public SnapshotPolicyProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotPolicyProperties class. + /// + + /// Schedule for hourly snapshots + /// + + /// Schedule for daily snapshots + /// + + /// Schedule for weekly snapshots + /// + + /// Schedule for monthly snapshots + /// + + /// The property to decide policy is enabled or not + /// + + /// Azure lifecycle management + /// + public SnapshotPolicyProperties(HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + + { + this.HourlySchedule = hourlySchedule; + this.DailySchedule = dailySchedule; + this.WeeklySchedule = weeklySchedule; + this.MonthlySchedule = monthlySchedule; + this.Enabled = enabled; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets schedule for hourly snapshots + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hourlySchedule")] + public HourlySchedule HourlySchedule {get; set; } + + /// + /// Gets or sets schedule for daily snapshots + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dailySchedule")] + public DailySchedule DailySchedule {get; set; } + + /// + /// Gets or sets schedule for weekly snapshots + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "weeklySchedule")] + public WeeklySchedule WeeklySchedule {get; set; } + + /// + /// Gets or sets schedule for monthly snapshots + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "monthlySchedule")] + public MonthlySchedule MonthlySchedule {get; set; } + + /// + /// Gets or sets the property to decide policy is enabled or not + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyVolumeList.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyVolumeList.cs index 9ad8d0974c63..1c52f44a76fd 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyVolumeList.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotPolicyVolumeList.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public SnapshotPolicyVolumeList() /// /// Initializes a new instance of the SnapshotPolicyVolumeList class. /// - /// List of volumes - public SnapshotPolicyVolumeList(IList value = default(IList)) + + /// List of volumes + /// + public SnapshotPolicyVolumeList(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public SnapshotPolicyVolumeList() /// partial void CustomInit(); + /// /// Gets or sets list of volumes /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotProperties.cs new file mode 100644 index 000000000000..73490da4adb3 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotProperties.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Snapshot properties + /// + public partial class SnapshotProperties + { + /// + /// Initializes a new instance of the SnapshotProperties class. + /// + public SnapshotProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotProperties class. + /// + + /// UUID v4 used to identify the Snapshot + /// + + /// The creation date of the snapshot + /// + + /// Azure lifecycle management + /// + public SnapshotProperties(string snapshotId = default(string), System.DateTime? created = default(System.DateTime?), string provisioningState = default(string)) + + { + this.SnapshotId = snapshotId; + this.Created = created; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets uUID v4 used to identify the Snapshot + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotId")] + public string SnapshotId {get; private set; } + + /// + /// Gets the creation date of the snapshot + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "created")] + public System.DateTime? Created {get; private set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.SnapshotId != null) + { + if (this.SnapshotId.Length > 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "SnapshotId", 36); + } + if (this.SnapshotId.Length < 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "SnapshotId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(this.SnapshotId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "SnapshotId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } + + } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotRestoreFiles.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotRestoreFiles.cs index d675db6dfa3c..45c268f505ea 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotRestoreFiles.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SnapshotRestoreFiles.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Restore payload for Single File Snapshot Restore /// - public partial class SnapshotRestoreFiles : IResource + public partial class SnapshotRestoreFiles : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the SnapshotRestoreFiles class. @@ -33,13 +23,17 @@ public SnapshotRestoreFiles() /// /// Initializes a new instance of the SnapshotRestoreFiles class. /// - /// List of files to be restored - /// Destination folder where the files - /// will be restored - public SnapshotRestoreFiles(IList filePaths, string destinationPath = default(string)) + + /// List of files to be restored + /// + + /// Destination folder where the files will be restored + /// + public SnapshotRestoreFiles(System.Collections.Generic.IList filePaths, string destinationPath = default(string)) + { - FilePaths = filePaths; - DestinationPath = destinationPath; + this.FilePaths = filePaths; + this.DestinationPath = destinationPath; CustomInit(); } @@ -48,41 +42,42 @@ public SnapshotRestoreFiles() /// partial void CustomInit(); + /// /// Gets or sets list of files to be restored /// - [JsonProperty(PropertyName = "filePaths")] - public IList FilePaths { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "filePaths")] + public System.Collections.Generic.IList FilePaths {get; set; } /// /// Gets or sets destination folder where the files will be restored /// - [JsonProperty(PropertyName = "destinationPath")] - public string DestinationPath { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "destinationPath")] + public string DestinationPath {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (FilePaths == null) + if (this.FilePaths == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "FilePaths"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "FilePaths"); } - if (FilePaths != null) + if (this.FilePaths != null) { - if (FilePaths.Count > 10) + if (this.FilePaths.Count > 10) { - throw new ValidationException(ValidationRules.MaxItems, "FilePaths", 10); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "FilePaths", 10); } - if (FilePaths.Count < 1) + if (this.FilePaths.Count < 1) { - throw new ValidationException(ValidationRules.MinItems, "FilePaths", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinItems, "FilePaths", 1); } } + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItem.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItem.cs index cf833389e792..bd6b66fc02d1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItem.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItem.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Information regarding Subscription Quota Item. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SubscriptionQuotaItem : ProxyResource { /// @@ -32,21 +24,33 @@ public SubscriptionQuotaItem() /// /// Initializes a new instance of the SubscriptionQuotaItem class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// The current quota value. - /// The default quota value. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The current quota value. + /// + + /// The default quota value. + /// public SubscriptionQuotaItem(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? current = default(int?), int? defaultProperty = default(int?)) - : base(id, name, type, systemData) + + : base(id, name, type, systemData) { - Current = current; - DefaultProperty = defaultProperty; + this.Current = current; + this.DefaultProperty = defaultProperty; CustomInit(); } @@ -55,17 +59,17 @@ public SubscriptionQuotaItem() /// partial void CustomInit(); + /// /// Gets the current quota value. /// - [JsonProperty(PropertyName = "properties.current")] - public int? Current { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.current")] + public int? Current {get; private set; } /// /// Gets the default quota value. /// - [JsonProperty(PropertyName = "properties.default")] - public int? DefaultProperty { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.default")] + public int? DefaultProperty {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItemProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItemProperties.cs new file mode 100644 index 000000000000..ad2c8ac3324a --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubscriptionQuotaItemProperties.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.NetApp.Models +{ + using System.Linq; + + /// + /// SubscriptionQuotaItem Properties + /// + public partial class SubscriptionQuotaItemProperties + { + /// + /// Initializes a new instance of the SubscriptionQuotaItemProperties class. + /// + public SubscriptionQuotaItemProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubscriptionQuotaItemProperties class. + /// + + /// The current quota value. + /// + + /// The default quota value. + /// + public SubscriptionQuotaItemProperties(int? current = default(int?), int? defaultProperty = default(int?)) + + { + this.Current = current; + this.DefaultProperty = defaultProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the current quota value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "current")] + public int? Current {get; private set; } + + /// + /// Gets the default quota value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + public int? DefaultProperty {get; private set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeInfo.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeInfo.cs index afb602a56744..30ff357e49e8 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeInfo.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeInfo.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Subvolume Information properties /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SubvolumeInfo : ProxyResource { /// @@ -32,25 +24,41 @@ public SubvolumeInfo() /// /// Initializes a new instance of the SubvolumeInfo class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// path - /// size - /// name - /// Azure lifecycle management + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Path to the subvolume + /// + + /// Truncate subvolume to the provided size in bytes + /// + + /// parent path to the subvolume + /// + + /// Azure lifecycle management + /// public SubvolumeInfo(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string path = default(string), long? size = default(long?), string parentPath = default(string), string provisioningState = default(string)) - : base(id, name, type, systemData) + + : base(id, name, type, systemData) { - Path = path; - Size = size; - ParentPath = parentPath; - ProvisioningState = provisioningState; + this.Path = path; + this.Size = size; + this.ParentPath = parentPath; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -59,38 +67,29 @@ public SubvolumeInfo() /// partial void CustomInit(); + /// - /// Gets or sets path + /// Gets or sets path to the subvolume /// - /// - /// Path to the subvolume - /// - [JsonProperty(PropertyName = "properties.path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] + public string Path {get; set; } /// - /// Gets or sets size + /// Gets or sets truncate subvolume to the provided size in bytes /// - /// - /// Truncate subvolume to the provided size in bytes - /// - [JsonProperty(PropertyName = "properties.size")] - public long? Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long? Size {get; set; } /// - /// Gets or sets name + /// Gets or sets parent path to the subvolume /// - /// - /// parent path to the subvolume - /// - [JsonProperty(PropertyName = "properties.parentPath")] - public string ParentPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parentPath")] + public string ParentPath {get; set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModel.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModel.cs index 1002b92659a5..e1f590c1aab4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModel.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModel.cs @@ -1,25 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Result of the post subvolume and action is to get metadata of the /// subvolume. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SubvolumeModel { /// @@ -33,34 +25,61 @@ public SubvolumeModel() /// /// Initializes a new instance of the SubvolumeModel class. /// - /// Resource Id - /// Resource name - /// Resource type - /// path - /// parentpath - /// size - /// bytesUsed - /// permissions - /// creationTimeStamp - /// accessedTimeStamp - /// modifiedTimeStamp - /// changedTimeStamp - /// Azure lifecycle management + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Path to the subvolume + /// + + /// Path to the parent subvolume + /// + + /// Size of subvolume + /// + + /// Bytes used + /// + + /// Permissions of the subvolume + /// + + /// Creation time and date + /// + + /// Most recent access time and date + /// + + /// Most recent modification time and date + /// + + /// Most recent change time and date + /// + + /// Azure lifecycle management + /// public SubvolumeModel(string id = default(string), string name = default(string), string type = default(string), string path = default(string), string parentPath = default(string), long? size = default(long?), long? bytesUsed = default(long?), string permissions = default(string), System.DateTime? creationTimeStamp = default(System.DateTime?), System.DateTime? accessedTimeStamp = default(System.DateTime?), System.DateTime? modifiedTimeStamp = default(System.DateTime?), System.DateTime? changedTimeStamp = default(System.DateTime?), string provisioningState = default(string)) + { - Id = id; - Name = name; - Type = type; - Path = path; - ParentPath = parentPath; - Size = size; - BytesUsed = bytesUsed; - Permissions = permissions; - CreationTimeStamp = creationTimeStamp; - AccessedTimeStamp = accessedTimeStamp; - ModifiedTimeStamp = modifiedTimeStamp; - ChangedTimeStamp = changedTimeStamp; - ProvisioningState = provisioningState; + this.Id = id; + this.Name = name; + this.Type = type; + this.Path = path; + this.ParentPath = parentPath; + this.Size = size; + this.BytesUsed = bytesUsed; + this.Permissions = permissions; + this.CreationTimeStamp = creationTimeStamp; + this.AccessedTimeStamp = accessedTimeStamp; + this.ModifiedTimeStamp = modifiedTimeStamp; + this.ChangedTimeStamp = changedTimeStamp; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -69,110 +88,83 @@ public SubvolumeModel() /// partial void CustomInit(); + /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// - /// Gets or sets path + /// Gets or sets path to the subvolume /// - /// - /// Path to the subvolume - /// - [JsonProperty(PropertyName = "properties.path")] - public string Path { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] + public string Path {get; set; } /// - /// Gets or sets parentpath + /// Gets or sets path to the parent subvolume /// - /// - /// Path to the parent subvolume - /// - [JsonProperty(PropertyName = "properties.parentPath")] - public string ParentPath { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.parentPath")] + public string ParentPath {get; set; } /// - /// Gets or sets size + /// Gets or sets size of subvolume /// - /// - /// Size of subvolume - /// - [JsonProperty(PropertyName = "properties.size")] - public long? Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long? Size {get; set; } /// - /// Gets or sets bytesUsed + /// Gets or sets bytes used /// - /// - /// Bytes used - /// - [JsonProperty(PropertyName = "properties.bytesUsed")] - public long? BytesUsed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.bytesUsed")] + public long? BytesUsed {get; set; } /// - /// Gets or sets permissions + /// Gets or sets permissions of the subvolume /// - /// - /// Permissions of the subvolume - /// - [JsonProperty(PropertyName = "properties.permissions")] - public string Permissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.permissions")] + public string Permissions {get; set; } /// - /// Gets or sets creationTimeStamp + /// Gets or sets creation time and date /// - /// - /// Creation time and date - /// - [JsonProperty(PropertyName = "properties.creationTimeStamp")] - public System.DateTime? CreationTimeStamp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationTimeStamp")] + public System.DateTime? CreationTimeStamp {get; set; } /// - /// Gets or sets accessedTimeStamp + /// Gets or sets most recent access time and date /// - /// - /// Most recent access time and date - /// - [JsonProperty(PropertyName = "properties.accessedTimeStamp")] - public System.DateTime? AccessedTimeStamp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.accessedTimeStamp")] + public System.DateTime? AccessedTimeStamp {get; set; } /// - /// Gets or sets modifiedTimeStamp + /// Gets or sets most recent modification time and date /// - /// - /// Most recent modification time and date - /// - [JsonProperty(PropertyName = "properties.modifiedTimeStamp")] - public System.DateTime? ModifiedTimeStamp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.modifiedTimeStamp")] + public System.DateTime? ModifiedTimeStamp {get; set; } /// - /// Gets or sets changedTimeStamp + /// Gets or sets most recent change time and date /// - /// - /// Most recent change time and date - /// - [JsonProperty(PropertyName = "properties.changedTimeStamp")] - public System.DateTime? ChangedTimeStamp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.changedTimeStamp")] + public System.DateTime? ChangedTimeStamp {get; set; } /// /// Gets or sets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModelProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModelProperties.cs new file mode 100644 index 000000000000..a3e847267313 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeModelProperties.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Properties which represents actual subvolume model which is stored as a + /// file in the system. + /// + public partial class SubvolumeModelProperties + { + /// + /// Initializes a new instance of the SubvolumeModelProperties class. + /// + public SubvolumeModelProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubvolumeModelProperties class. + /// + + /// Path to the subvolume + /// + + /// Path to the parent subvolume + /// + + /// Size of subvolume + /// + + /// Bytes used + /// + + /// Permissions of the subvolume + /// + + /// Creation time and date + /// + + /// Most recent access time and date + /// + + /// Most recent modification time and date + /// + + /// Most recent change time and date + /// + + /// Azure lifecycle management + /// + public SubvolumeModelProperties(string path = default(string), string parentPath = default(string), long? size = default(long?), long? bytesUsed = default(long?), string permissions = default(string), System.DateTime? creationTimeStamp = default(System.DateTime?), System.DateTime? accessedTimeStamp = default(System.DateTime?), System.DateTime? modifiedTimeStamp = default(System.DateTime?), System.DateTime? changedTimeStamp = default(System.DateTime?), string provisioningState = default(string)) + + { + this.Path = path; + this.ParentPath = parentPath; + this.Size = size; + this.BytesUsed = bytesUsed; + this.Permissions = permissions; + this.CreationTimeStamp = creationTimeStamp; + this.AccessedTimeStamp = accessedTimeStamp; + this.ModifiedTimeStamp = modifiedTimeStamp; + this.ChangedTimeStamp = changedTimeStamp; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets path to the subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } + + /// + /// Gets or sets path to the parent subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parentPath")] + public string ParentPath {get; set; } + + /// + /// Gets or sets size of subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public long? Size {get; set; } + + /// + /// Gets or sets bytes used + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "bytesUsed")] + public long? BytesUsed {get; set; } + + /// + /// Gets or sets permissions of the subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] + public string Permissions {get; set; } + + /// + /// Gets or sets creation time and date + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationTimeStamp")] + public System.DateTime? CreationTimeStamp {get; set; } + + /// + /// Gets or sets most recent access time and date + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "accessedTimeStamp")] + public System.DateTime? AccessedTimeStamp {get; set; } + + /// + /// Gets or sets most recent modification time and date + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedTimeStamp")] + public System.DateTime? ModifiedTimeStamp {get; set; } + + /// + /// Gets or sets most recent change time and date + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "changedTimeStamp")] + public System.DateTime? ChangedTimeStamp {get; set; } + + /// + /// Gets or sets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchParams.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchParams.cs new file mode 100644 index 000000000000..af747c33ce1d --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchParams.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.NetApp.Models +{ + using System.Linq; + + /// + /// Parameters with which a subvolume can be updated + /// + public partial class SubvolumePatchParams + { + /// + /// Initializes a new instance of the SubvolumePatchParams class. + /// + public SubvolumePatchParams() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubvolumePatchParams class. + /// + + /// Truncate subvolume to the provided size in bytes + /// + + /// path to the subvolume + /// + public SubvolumePatchParams(long? size = default(long?), string path = default(string)) + + { + this.Size = size; + this.Path = path; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets truncate subvolume to the provided size in bytes + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public long? Size {get; set; } + + /// + /// Gets or sets path to the subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchRequest.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchRequest.cs index d8629e376708..3efcf0ee3911 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchRequest.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumePatchRequest.cs @@ -1,26 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Subvolume Patch Request properties /// - [Rest.Serialization.JsonTransformation] - public partial class SubvolumePatchRequest : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class SubvolumePatchRequest : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the SubvolumePatchRequest class. @@ -33,12 +24,17 @@ public SubvolumePatchRequest() /// /// Initializes a new instance of the SubvolumePatchRequest class. /// - /// size - /// path + + /// Truncate subvolume to the provided size in bytes + /// + + /// path to the subvolume + /// public SubvolumePatchRequest(long? size = default(long?), string path = default(string)) + { - Size = size; - Path = path; + this.Size = size; + this.Path = path; CustomInit(); } @@ -47,23 +43,17 @@ public SubvolumePatchRequest() /// partial void CustomInit(); + /// - /// Gets or sets size + /// Gets or sets truncate subvolume to the provided size in bytes /// - /// - /// Truncate subvolume to the provided size in bytes - /// - [JsonProperty(PropertyName = "properties.size")] - public long? Size { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.size")] + public long? Size {get; set; } /// - /// Gets or sets path + /// Gets or sets path to the subvolume /// - /// - /// path to the subvolume - /// - [JsonProperty(PropertyName = "properties.path")] - public string Path { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.path")] + public string Path {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeProperties.cs new file mode 100644 index 000000000000..4814983520cf --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SubvolumeProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// This represents path associated with the subvolume + /// + public partial class SubvolumeProperties + { + /// + /// Initializes a new instance of the SubvolumeProperties class. + /// + public SubvolumeProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubvolumeProperties class. + /// + + /// Path to the subvolume + /// + + /// Truncate subvolume to the provided size in bytes + /// + + /// parent path to the subvolume + /// + + /// Azure lifecycle management + /// + public SubvolumeProperties(string path = default(string), long? size = default(long?), string parentPath = default(string), string provisioningState = default(string)) + + { + this.Path = path; + this.Size = size; + this.ParentPath = parentPath; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets path to the subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "path")] + public string Path {get; set; } + + /// + /// Gets or sets truncate subvolume to the provided size in bytes + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "size")] + public long? Size {get; set; } + + /// + /// Gets or sets parent path to the subvolume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "parentPath")] + public string ParentPath {get; set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SystemData.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SystemData.cs index b43ccc009ba0..72d333ea9412 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SystemData.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/SystemData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,33 @@ public SystemData() /// /// 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 timestamp of resource last - /// modification (UTC) + + /// 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 timestamp of resource last modification (UTC) + /// 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; + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; CustomInit(); } @@ -59,45 +58,41 @@ public SystemData() /// partial void CustomInit(); + /// /// Gets or sets the identity that created the resource. /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } + [Newtonsoft.Json.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' + /// 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; } + [Newtonsoft.Json.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; } + [Newtonsoft.Json.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; } + [Newtonsoft.Json.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' + /// 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; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } /// /// Gets or sets the timestamp of resource last modification (UTC) /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/TrackedResource.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/TrackedResource.cs index 900fcf33d8ec..46fe33423faa 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/TrackedResource.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/TrackedResource.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Tracked Resource + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' /// /// /// The resource model definition for an Azure Resource Manager tracked top - /// level resource which has 'tags' and a 'location' + /// level resource which has 'tags' and a 'location' /// public partial class TrackedResource : Resource { @@ -36,22 +28,33 @@ public TrackedResource() /// /// Initializes a new instance of the TrackedResource class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) - : base(id, name, type, systemData) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type, systemData) { - Tags = tags; - Location = location; + this.Tags = tags; + this.Location = location; CustomInit(); } @@ -60,30 +63,32 @@ public TrackedResource() /// partial void CustomInit(); + /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets the geo-location where the resource lives /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Type.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Type.cs index 4f04f83ff300..1fb049cb5c22 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Type.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Type.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for Type. /// + + public static class Type { /// @@ -33,4 +30,4 @@ public static class Type /// public const string IndividualGroupQuota = "IndividualGroupQuota"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/UserAssignedIdentity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/UserAssignedIdentity.cs index 9c60d83ae739..ddc6fb1f5ab7 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/UserAssignedIdentity.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/UserAssignedIdentity.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public UserAssignedIdentity() /// /// Initializes a new instance of the UserAssignedIdentity class. /// - /// The principal ID of the assigned - /// identity. - /// The client ID of the assigned - /// identity. + + /// The principal ID of the assigned identity. + /// + + /// The client ID of the assigned identity. + /// public UserAssignedIdentity(System.Guid? principalId = default(System.Guid?), System.Guid? clientId = default(System.Guid?)) + { - PrincipalId = principalId; - ClientId = clientId; + this.PrincipalId = principalId; + this.ClientId = clientId; CustomInit(); } @@ -45,17 +42,17 @@ public UserAssignedIdentity() /// partial void CustomInit(); + /// /// Gets the principal ID of the assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public System.Guid? PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public System.Guid? PrincipalId {get; private set; } /// /// Gets the client ID of the assigned identity. /// - [JsonProperty(PropertyName = "clientId")] - public System.Guid? ClientId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public System.Guid? ClientId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Volume.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Volume.cs index f44d1880543e..76ec1feb6fab 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Volume.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/Volume.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Volume resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Volume : TrackedResource { /// @@ -34,193 +24,291 @@ public Volume() /// /// Initializes a new instance of the Volume class. /// - /// The geo-location where the resource - /// lives - /// Creation Token or File Path - /// usageThreshold - /// The Azure Resource URI for a delegated - /// subnet. Must have the delegation Microsoft.NetApp/volumes + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// Availability Zone - /// FileSystem ID - /// serviceLevel - /// exportPolicy - /// protocolTypes - /// Azure lifecycle management - /// Snapshot ID - /// If enabled (true) the snapshot the - /// volume was created from will be automatically deleted after the - /// volume create operation has finished. Defaults to false - /// Backup ID - /// Baremetal Tenant ID - /// Network features - /// Network Sibling Set ID - /// Storage to Network - /// Proximity - /// mountTargets - /// What type of volume is this. For - /// destination volumes in Cross Region Replication, set type to - /// DataProtection - /// DataProtection - /// Restoring - /// If enabled (true) the volume - /// will contain a read-only snapshot directory which provides access - /// to each of the volume's snapshots (defaults to true). - /// Describe if a volume is - /// KerberosEnabled. To be use with swagger version 2020-05-01 or - /// later - /// The security style of volume, default - /// unix, defaults to ntfs for dual protocol or CIFS protocol. Possible - /// values include: 'ntfs', 'unix' - /// Enables encryption for in-flight smb3 - /// data. Only applicable for SMB/DualProtocol volume. To be used with - /// swagger version 2020-08-01 or later - /// smbAccessBasedEnumeration - /// smbNonBrowsable - /// Enables continuously - /// available share property for smb volume. Only applicable for SMB - /// volume - /// Maximum throughput in MiB/s that can - /// be achieved by this volume and this will be accepted as input only - /// for manual qosType volume - /// Actual throughput in MiB/s for - /// auto qosType volumes calculated based on size and - /// serviceLevel - /// Source of key used to encrypt - /// data in volume. Applicable if NetApp account has - /// encryption.keySource = 'Microsoft.KeyVault'. Possible values - /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. - /// Possible values include: 'Microsoft.NetApp', - /// 'Microsoft.KeyVault' - /// The resource ID of - /// private endpoint for KeyVault. It must reside in the same VNET as - /// the volume. Only applicable if encryptionKeySource = - /// 'Microsoft.KeyVault'. - /// Specifies whether LDAP is enabled or not - /// for a given NFS volume. - /// Specifies whether Cool Access(tiering) is - /// enabled for the volume. - /// Specifies the number of days after - /// which data that is not accessed by clients will be tiered. - /// UNIX permissions for NFS volume - /// accepted in octal 4 digit format. First digit selects the set user - /// ID(4), set group ID (2) and sticky (1) attributes. Second digit - /// selects permission for the owner of the file: read (4), write (2) - /// and execute (1). Third selects permissions for other users in the - /// same group. the fourth for other users not in the group. 0755 - - /// gives read/write/execute permissions to owner and read/execute to - /// group and other users. - /// When a volume is being restored from - /// another volume's snapshot, will show the percentage completion of - /// this cloning process. When this value is empty/null there is no - /// cloning process currently happening on this volume. This value will - /// update every 5 minutes during cloning. - /// Flag indicating whether file access - /// logs are enabled for the volume, based on active diagnostic - /// settings present on the volume. Possible values include: 'Enabled', - /// 'Disabled' - /// avsDataStore - /// dataStoreResourceId - /// Specifies if default quota is - /// enabled for the volume. - /// Default user quota for volume - /// in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 - /// KiBs applies . - /// Default group quota for - /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value - /// of 4 KiBs applies. - /// Maximum number of files allowed. - /// Needs a service request in order to be changed. Only allowed to be - /// changed if volume quota is more than 4TiB. - /// Volume Group Name - /// Pool Resource Id used in case - /// of creating a volume through volume group - /// Proximity placement group - /// associated with the volume - /// T2 network information - /// Volume spec name is the application - /// specific designation or identifier for the particular volume in a - /// volume group for e.g. data, log - /// Specifies if the volume is encrypted or - /// not. Only available on volumes created or updated after - /// 2022-01-01. - /// Volume placement rules - /// Flag indicating whether subvolume - /// operations are enabled on the volume. Possible values include: - /// 'Enabled', 'Disabled' - /// Provisioned Availability - /// Zone - /// Is Large Volume - /// Originating Resource Id - public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), IList zones = default(IList), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), double? actualThroughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string fileAccessLogs = default(string), string avsDataStore = default(string), IList dataStoreResourceId = default(IList), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), IList placementRules = default(IList), string enableSubvolumes = default(string), string provisionedAvailabilityZone = default(string), bool? isLargeVolume = default(bool?), string originatingResourceId = default(string)) - : base(location, id, name, type, systemData, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// A unique read-only string that changes whenever the resource is updated. + /// + + /// Availability Zone + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// Basic network, or Standard features available to the volume. + /// Possible values include: 'Basic', 'Standard' + + /// The security style of volume, default unix, defaults to ntfs for dual + /// protocol or CIFS protocol + /// Possible values include: 'ntfs', 'unix' + + /// Flag indicating whether subvolume operations are enabled on the volume + /// Possible values include: 'Enabled', 'Disabled' + + /// Unique FileSystem Identifier. + /// + + /// A unique file path for the volume. Used when creating mount targets + /// + + /// Maximum storage quota allowed for a file system in bytes. This is a soft + /// quota used for alerting only. Minimum size is 100 GiB. Upper limit is + /// 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + + /// Set of export policy rules + /// + + /// Set of protocol types, default NFSv3, CIFS for SMB protocol + /// + + /// Azure lifecycle management + /// + + /// UUID v4 or resource identifier used to identify the Snapshot. + /// + + /// If enabled (true) the snapshot the volume was created from will be + /// automatically deleted after the volume create operation has finished. + /// Defaults to false + /// + + /// UUID v4 or resource identifier used to identify the Backup. + /// + + /// Unique Baremetal Tenant Identifier. + /// + + /// The Azure Resource URI for a delegated subnet. Must have the delegation + /// Microsoft.NetApp/volumes + /// + + /// Network Sibling Set ID for the the group of volumes sharing networking + /// resources. + /// + + /// Provides storage to network proximity information for the volume. + /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' + + /// List of mount targets + /// + + /// What type of volume is this. For destination volumes in Cross Region + /// Replication, set type to DataProtection + /// + + /// DataProtection type volumes include an object containing details of the + /// replication + /// + + /// Restoring + /// + + /// If enabled (true) the volume will contain a read-only snapshot directory + /// which provides access to each of the volume's snapshots (defaults to true). + /// + + /// Describe if a volume is KerberosEnabled. To be use with swagger version + /// 2020-05-01 or later + /// + + /// Enables encryption for in-flight smb3 data. Only applicable for + /// SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + /// later + /// + + /// Enables access based enumeration share property for SMB Shares. Only + /// applicable for SMB/DualProtocol volume + /// Possible values include: 'Disabled', 'Enabled' + + /// Enables non browsable property for SMB Shares. Only applicable for + /// SMB/DualProtocol volume + /// Possible values include: 'Disabled', 'Enabled' + + /// Enables continuously available share property for smb volume. Only + /// applicable for SMB volume + /// + + /// Maximum throughput in MiB/s that can be achieved by this volume and this + /// will be accepted as input only for manual qosType volume + /// + + /// Actual throughput in MiB/s for auto qosType volumes calculated based on + /// size and serviceLevel + /// + + /// Source of key used to encrypt data in volume. Applicable if NetApp account + /// has encryption.keySource = 'Microsoft.KeyVault'. Possible values + /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault' + /// Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' + + /// The resource ID of private endpoint for KeyVault. It must reside in the + /// same VNET as the volume. Only applicable if encryptionKeySource = + /// 'Microsoft.KeyVault'. + /// + + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// + + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// + + /// Specifies the number of days after which data that is not accessed by + /// clients will be tiered. + /// + + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First + /// digit selects the set user ID(4), set group ID (2) and sticky (1) + /// attributes. Second digit selects permission for the owner of the file: read + /// (4), write (2) and execute (1). Third selects permissions for other users + /// in the same group. the fourth for other users not in the group. 0755 - + /// gives read/write/execute permissions to owner and read/execute to group and + /// other users. + /// + + /// When a volume is being restored from another volume's snapshot, will show + /// the percentage completion of this cloning process. When this value is + /// empty/null there is no cloning process currently happening on this volume. + /// This value will update every 5 minutes during cloning. + /// + + /// Flag indicating whether file access logs are enabled for the volume, based + /// on active diagnostic settings present on the volume. + /// Possible values include: 'Enabled', 'Disabled' + + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) + /// datastore purpose + /// Possible values include: 'Enabled', 'Disabled' + + /// Data store resource unique identifier + /// + + /// Specifies if default quota is enabled for the volume. + /// + + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the + /// minimum value of 4 KiBs applies . + /// + + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, + /// the minimum value of 4 KiBs applies. + /// + + /// Maximum number of files allowed. Needs a service request in order to be + /// changed. Only allowed to be changed if volume quota is more than 4TiB. + /// + + /// Volume Group Name + /// + + /// Pool Resource Id used in case of creating a volume through volume group + /// + + /// Proximity placement group associated with the volume + /// + + /// T2 network information + /// + + /// Volume spec name is the application specific designation or identifier for + /// the particular volume in a volume group for e.g. data, log + /// + + /// Specifies if the volume is encrypted or not. Only available on volumes + /// created or updated after 2022-01-01. + /// + + /// Application specific placement rules for the particular volume + /// + + /// The availability zone where the volume is provisioned. This refers to the + /// logical availability zone where the volume resides. + /// + + /// Specifies whether volume is a Large Volume or Regular Volume. + /// + + /// Id of the snapshot or backup that the volume is restored from. + /// + public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), string serviceLevel = default(string), string networkFeatures = default(string), string securityStyle = default(string), string enableSubvolumes = default(string), string fileSystemId = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), System.Collections.Generic.IList protocolTypes = default(System.Collections.Generic.IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), System.Collections.Generic.IList mountTargets = default(System.Collections.Generic.IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), double? actualThroughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string fileAccessLogs = default(string), string avsDataStore = default(string), System.Collections.Generic.IList dataStoreResourceId = default(System.Collections.Generic.IList), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), System.Collections.Generic.IList placementRules = default(System.Collections.Generic.IList), string provisionedAvailabilityZone = default(string), bool? isLargeVolume = default(bool?), string originatingResourceId = default(string)) + + : base(location, id, name, type, systemData, tags) { - Etag = etag; - Zones = zones; - FileSystemId = fileSystemId; - CreationToken = creationToken; - ServiceLevel = serviceLevel; - UsageThreshold = usageThreshold; - ExportPolicy = exportPolicy; - ProtocolTypes = protocolTypes; - ProvisioningState = provisioningState; - SnapshotId = snapshotId; - DeleteBaseSnapshot = deleteBaseSnapshot; - BackupId = backupId; - BaremetalTenantId = baremetalTenantId; - SubnetId = subnetId; - NetworkFeatures = networkFeatures; - NetworkSiblingSetId = networkSiblingSetId; - StorageToNetworkProximity = storageToNetworkProximity; - MountTargets = mountTargets; - VolumeType = volumeType; - DataProtection = dataProtection; - IsRestoring = isRestoring; - SnapshotDirectoryVisible = snapshotDirectoryVisible; - KerberosEnabled = kerberosEnabled; - SecurityStyle = securityStyle; - SmbEncryption = smbEncryption; - SmbAccessBasedEnumeration = smbAccessBasedEnumeration; - SmbNonBrowsable = smbNonBrowsable; - SmbContinuouslyAvailable = smbContinuouslyAvailable; - ThroughputMibps = throughputMibps; - ActualThroughputMibps = actualThroughputMibps; - EncryptionKeySource = encryptionKeySource; - KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; - LdapEnabled = ldapEnabled; - CoolAccess = coolAccess; - CoolnessPeriod = coolnessPeriod; - UnixPermissions = unixPermissions; - CloneProgress = cloneProgress; - FileAccessLogs = fileAccessLogs; - AvsDataStore = avsDataStore; - DataStoreResourceId = dataStoreResourceId; - IsDefaultQuotaEnabled = isDefaultQuotaEnabled; - DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; - DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; - MaximumNumberOfFiles = maximumNumberOfFiles; - VolumeGroupName = volumeGroupName; - CapacityPoolResourceId = capacityPoolResourceId; - ProximityPlacementGroup = proximityPlacementGroup; - T2Network = t2Network; - VolumeSpecName = volumeSpecName; - Encrypted = encrypted; - PlacementRules = placementRules; - EnableSubvolumes = enableSubvolumes; - ProvisionedAvailabilityZone = provisionedAvailabilityZone; - IsLargeVolume = isLargeVolume; - OriginatingResourceId = originatingResourceId; + this.Etag = etag; + this.Zones = zones; + this.ServiceLevel = serviceLevel; + this.NetworkFeatures = networkFeatures; + this.SecurityStyle = securityStyle; + this.EnableSubvolumes = enableSubvolumes; + this.FileSystemId = fileSystemId; + this.CreationToken = creationToken; + this.UsageThreshold = usageThreshold; + this.ExportPolicy = exportPolicy; + this.ProtocolTypes = protocolTypes; + this.ProvisioningState = provisioningState; + this.SnapshotId = snapshotId; + this.DeleteBaseSnapshot = deleteBaseSnapshot; + this.BackupId = backupId; + this.BaremetalTenantId = baremetalTenantId; + this.SubnetId = subnetId; + this.NetworkSiblingSetId = networkSiblingSetId; + this.StorageToNetworkProximity = storageToNetworkProximity; + this.MountTargets = mountTargets; + this.VolumeType = volumeType; + this.DataProtection = dataProtection; + this.IsRestoring = isRestoring; + this.SnapshotDirectoryVisible = snapshotDirectoryVisible; + this.KerberosEnabled = kerberosEnabled; + this.SmbEncryption = smbEncryption; + this.SmbAccessBasedEnumeration = smbAccessBasedEnumeration; + this.SmbNonBrowsable = smbNonBrowsable; + this.SmbContinuouslyAvailable = smbContinuouslyAvailable; + this.ThroughputMibps = throughputMibps; + this.ActualThroughputMibps = actualThroughputMibps; + this.EncryptionKeySource = encryptionKeySource; + this.KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; + this.LdapEnabled = ldapEnabled; + this.CoolAccess = coolAccess; + this.CoolnessPeriod = coolnessPeriod; + this.UnixPermissions = unixPermissions; + this.CloneProgress = cloneProgress; + this.FileAccessLogs = fileAccessLogs; + this.AvsDataStore = avsDataStore; + this.DataStoreResourceId = dataStoreResourceId; + this.IsDefaultQuotaEnabled = isDefaultQuotaEnabled; + this.DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; + this.DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + this.MaximumNumberOfFiles = maximumNumberOfFiles; + this.VolumeGroupName = volumeGroupName; + this.CapacityPoolResourceId = capacityPoolResourceId; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.T2Network = t2Network; + this.VolumeSpecName = volumeSpecName; + this.Encrypted = encrypted; + this.PlacementRules = placementRules; + this.ProvisionedAvailabilityZone = provisionedAvailabilityZone; + this.IsLargeVolume = isLargeVolume; + this.OriginatingResourceId = originatingResourceId; CustomInit(); } @@ -229,536 +317,470 @@ public Volume() /// partial void CustomInit(); + /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. + /// Gets a unique read-only string that changes whenever the resource is + /// updated. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } /// /// Gets or sets availability Zone /// - [JsonProperty(PropertyName = "zones")] - public IList Zones { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "zones")] + public System.Collections.Generic.IList Zones {get; set; } /// - /// Gets fileSystem ID + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' /// - /// - /// Unique FileSystem Identifier. - /// - [JsonProperty(PropertyName = "properties.fileSystemId")] - public string FileSystemId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceLevel")] + public string ServiceLevel {get; set; } /// - /// Gets or sets creation Token or File Path + /// Gets or sets basic network, or Standard features available to the volume. Possible values include: 'Basic', 'Standard' /// - /// - /// A unique file path for the volume. Used when creating mount targets - /// - [JsonProperty(PropertyName = "properties.creationToken")] - public string CreationToken { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkFeatures")] + public string NetworkFeatures {get; set; } /// - /// Gets or sets serviceLevel + /// Gets or sets the security style of volume, default unix, defaults to ntfs + /// for dual protocol or CIFS protocol Possible values include: 'ntfs', 'unix' /// - /// - /// Possible values include: 'Standard', 'Premium', 'Ultra', - /// 'StandardZRS' - /// - [JsonProperty(PropertyName = "properties.serviceLevel")] - public string ServiceLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityStyle")] + public string SecurityStyle {get; set; } /// - /// Gets or sets usageThreshold + /// Gets or sets flag indicating whether subvolume operations are enabled on + /// the volume Possible values include: 'Enabled', 'Disabled' /// - /// - /// Maximum storage quota allowed for a file system in bytes. This is a - /// soft quota used for alerting only. Minimum size is 100 GiB. Upper - /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. - /// - [JsonProperty(PropertyName = "properties.usageThreshold")] - public long UsageThreshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableSubvolumes")] + public string EnableSubvolumes {get; set; } /// - /// Gets or sets exportPolicy + /// Gets unique FileSystem Identifier. /// - /// - /// Set of export policy rules - /// - [JsonProperty(PropertyName = "properties.exportPolicy")] - public VolumePropertiesExportPolicy ExportPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fileSystemId")] + public string FileSystemId {get; private set; } /// - /// Gets or sets protocolTypes + /// Gets or sets a unique file path for the volume. Used when creating mount + /// targets /// - /// - /// Set of protocol types, default NFSv3, CIFS for SMB protocol - /// - [JsonProperty(PropertyName = "properties.protocolTypes")] - public IList ProtocolTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationToken")] + public string CreationToken {get; set; } /// - /// Gets azure lifecycle management + /// Gets or sets maximum storage quota allowed for a file system in bytes. This + /// is a soft quota used for alerting only. Minimum size is 100 GiB. Upper + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usageThreshold")] + public long UsageThreshold {get; set; } /// - /// Gets or sets snapshot ID + /// Gets or sets set of export policy rules /// - /// - /// UUID v4 or resource identifier used to identify the Snapshot. - /// - [JsonProperty(PropertyName = "properties.snapshotId")] - public string SnapshotId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.exportPolicy")] + public VolumePropertiesExportPolicy ExportPolicy {get; set; } /// - /// Gets or sets if enabled (true) the snapshot the volume was created - /// from will be automatically deleted after the volume create - /// operation has finished. Defaults to false + /// Gets or sets set of protocol types, default NFSv3, CIFS for SMB protocol /// - [JsonProperty(PropertyName = "properties.deleteBaseSnapshot")] - public bool? DeleteBaseSnapshot { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocolTypes")] + public System.Collections.Generic.IList ProtocolTypes {get; set; } /// - /// Gets or sets backup ID + /// Gets azure lifecycle management /// - /// - /// UUID v4 or resource identifier used to identify the Backup. - /// - [JsonProperty(PropertyName = "properties.backupId")] - public string BackupId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets baremetal Tenant ID + /// Gets or sets uUID v4 or resource identifier used to identify the Snapshot. /// - /// - /// Unique Baremetal Tenant Identifier. - /// - [JsonProperty(PropertyName = "properties.baremetalTenantId")] - public string BaremetalTenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotId")] + public string SnapshotId {get; set; } /// - /// Gets or sets the Azure Resource URI for a delegated subnet. Must - /// have the delegation Microsoft.NetApp/volumes + /// Gets or sets if enabled (true) the snapshot the volume was created from + /// will be automatically deleted after the volume create operation has + /// finished. Defaults to false /// - [JsonProperty(PropertyName = "properties.subnetId")] - public string SubnetId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteBaseSnapshot")] + public bool? DeleteBaseSnapshot {get; set; } /// - /// Gets or sets network features + /// Gets or sets uUID v4 or resource identifier used to identify the Backup. /// - /// - /// Basic network, or Standard features available to the volume. - /// Possible values include: 'Basic', 'Standard' - /// - [JsonProperty(PropertyName = "properties.networkFeatures")] - public string NetworkFeatures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupId")] + public string BackupId {get; set; } /// - /// Gets network Sibling Set ID + /// Gets unique Baremetal Tenant Identifier. /// - /// - /// Network Sibling Set ID for the the group of volumes sharing - /// networking resources. - /// - [JsonProperty(PropertyName = "properties.networkSiblingSetId")] - public string NetworkSiblingSetId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.baremetalTenantId")] + public string BaremetalTenantId {get; private set; } /// - /// Gets storage to Network Proximity + /// Gets or sets the Azure Resource URI for a delegated subnet. Must have the + /// delegation Microsoft.NetApp/volumes /// - /// - /// Provides storage to network proximity information for the volume. - /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' - /// - [JsonProperty(PropertyName = "properties.storageToNetworkProximity")] - public string StorageToNetworkProximity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId {get; set; } /// - /// Gets mountTargets + /// Gets network Sibling Set ID for the the group of volumes sharing networking + /// resources. /// - /// - /// List of mount targets - /// - [JsonProperty(PropertyName = "properties.mountTargets")] - public IList MountTargets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSiblingSetId")] + public string NetworkSiblingSetId {get; private set; } /// - /// Gets or sets what type of volume is this. For destination volumes - /// in Cross Region Replication, set type to DataProtection + /// Gets provides storage to network proximity information for the volume. Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' /// - [JsonProperty(PropertyName = "properties.volumeType")] - public string VolumeType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageToNetworkProximity")] + public string StorageToNetworkProximity {get; private set; } /// - /// Gets or sets dataProtection + /// Gets list of mount targets /// - /// - /// DataProtection type volumes include an object containing details of - /// the replication - /// - [JsonProperty(PropertyName = "properties.dataProtection")] - public VolumePropertiesDataProtection DataProtection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mountTargets")] + public System.Collections.Generic.IList MountTargets {get; private set; } /// - /// Gets or sets restoring + /// Gets or sets what type of volume is this. For destination volumes in Cross + /// Region Replication, set type to DataProtection /// - [JsonProperty(PropertyName = "properties.isRestoring")] - public bool? IsRestoring { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeType")] + public string VolumeType {get; set; } /// - /// Gets or sets if enabled (true) the volume will contain a read-only - /// snapshot directory which provides access to each of the volume's - /// snapshots (defaults to true). + /// Gets or sets dataProtection type volumes include an object containing + /// details of the replication /// - [JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] - public bool? SnapshotDirectoryVisible { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataProtection")] + public VolumePropertiesDataProtection DataProtection {get; set; } /// - /// Gets or sets describe if a volume is KerberosEnabled. To be use - /// with swagger version 2020-05-01 or later + /// Gets or sets restoring + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isRestoring")] + public bool? IsRestoring {get; set; } + + /// + /// Gets or sets if enabled (true) the volume will contain a read-only snapshot + /// directory which provides access to each of the volume's snapshots (defaults + /// to true). /// - [JsonProperty(PropertyName = "properties.kerberosEnabled")] - public bool? KerberosEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] + public bool? SnapshotDirectoryVisible {get; set; } /// - /// Gets or sets the security style of volume, default unix, defaults - /// to ntfs for dual protocol or CIFS protocol. Possible values - /// include: 'ntfs', 'unix' + /// Gets or sets describe if a volume is KerberosEnabled. To be use with + /// swagger version 2020-05-01 or later /// - [JsonProperty(PropertyName = "properties.securityStyle")] - public string SecurityStyle { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.kerberosEnabled")] + public bool? KerberosEnabled {get; set; } /// - /// Gets or sets enables encryption for in-flight smb3 data. Only - /// applicable for SMB/DualProtocol volume. To be used with swagger - /// version 2020-08-01 or later + /// Gets or sets enables encryption for in-flight smb3 data. Only applicable + /// for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + /// later /// - [JsonProperty(PropertyName = "properties.smbEncryption")] - public bool? SmbEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbEncryption")] + public bool? SmbEncryption {get; set; } /// - /// Gets or sets smbAccessBasedEnumeration + /// Gets or sets enables access based enumeration share property for SMB + /// Shares. Only applicable for SMB/DualProtocol volume Possible values include: 'Disabled', 'Enabled' /// - /// - /// Enables access based enumeration share property for SMB Shares. - /// Only applicable for SMB/DualProtocol volume. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "properties.smbAccessBasedEnumeration")] - public string SmbAccessBasedEnumeration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbAccessBasedEnumeration")] + public string SmbAccessBasedEnumeration {get; set; } /// - /// Gets or sets smbNonBrowsable + /// Gets or sets enables non browsable property for SMB Shares. Only applicable + /// for SMB/DualProtocol volume Possible values include: 'Disabled', 'Enabled' /// - /// - /// Enables non browsable property for SMB Shares. Only applicable for - /// SMB/DualProtocol volume. Possible values include: 'Disabled', - /// 'Enabled' - /// - [JsonProperty(PropertyName = "properties.smbNonBrowsable")] - public string SmbNonBrowsable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbNonBrowsable")] + public string SmbNonBrowsable {get; set; } /// - /// Gets or sets enables continuously available share property for smb - /// volume. Only applicable for SMB volume + /// Gets or sets enables continuously available share property for smb volume. + /// Only applicable for SMB volume /// - [JsonProperty(PropertyName = "properties.smbContinuouslyAvailable")] - public bool? SmbContinuouslyAvailable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbContinuouslyAvailable")] + public bool? SmbContinuouslyAvailable {get; set; } /// - /// Gets or sets maximum throughput in MiB/s that can be achieved by - /// this volume and this will be accepted as input only for manual - /// qosType volume + /// Gets or sets maximum throughput in MiB/s that can be achieved by this + /// volume and this will be accepted as input only for manual qosType volume /// - [JsonProperty(PropertyName = "properties.throughputMibps")] - public double? ThroughputMibps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.throughputMibps")] + public double? ThroughputMibps {get; set; } /// - /// Gets actual throughput in MiB/s for auto qosType volumes calculated - /// based on size and serviceLevel + /// Gets actual throughput in MiB/s for auto qosType volumes calculated based + /// on size and serviceLevel /// - [JsonProperty(PropertyName = "properties.actualThroughputMibps")] - public double? ActualThroughputMibps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actualThroughputMibps")] + public double? ActualThroughputMibps {get; private set; } /// - /// Gets or sets source of key used to encrypt data in volume. - /// Applicable if NetApp account has encryption.keySource = - /// 'Microsoft.KeyVault'. Possible values (case-insensitive) are: - /// 'Microsoft.NetApp, Microsoft.KeyVault'. Possible values include: - /// 'Microsoft.NetApp', 'Microsoft.KeyVault' + /// Gets or sets source of key used to encrypt data in volume. Applicable if + /// NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible + /// values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault' Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' /// - [JsonProperty(PropertyName = "properties.encryptionKeySource")] - public string EncryptionKeySource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionKeySource")] + public string EncryptionKeySource {get; set; } /// - /// Gets or sets the resource ID of private endpoint for KeyVault. It - /// must reside in the same VNET as the volume. Only applicable if - /// encryptionKeySource = 'Microsoft.KeyVault'. + /// Gets or sets the resource ID of private endpoint for KeyVault. It must + /// reside in the same VNET as the volume. Only applicable if + /// encryptionKeySource = 'Microsoft.KeyVault'. /// - [JsonProperty(PropertyName = "properties.keyVaultPrivateEndpointResourceId")] - public string KeyVaultPrivateEndpointResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultPrivateEndpointResourceId")] + public string KeyVaultPrivateEndpointResourceId {get; set; } /// - /// Gets or sets specifies whether LDAP is enabled or not for a given - /// NFS volume. + /// Gets or sets specifies whether LDAP is enabled or not for a given NFS + /// volume. /// - [JsonProperty(PropertyName = "properties.ldapEnabled")] - public bool? LdapEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ldapEnabled")] + public bool? LdapEnabled {get; set; } /// - /// Gets or sets specifies whether Cool Access(tiering) is enabled for - /// the volume. + /// Gets or sets specifies whether Cool Access(tiering) is enabled for the + /// volume. /// - [JsonProperty(PropertyName = "properties.coolAccess")] - public bool? CoolAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess {get; set; } /// - /// Gets or sets specifies the number of days after which data that is - /// not accessed by clients will be tiered. + /// Gets or sets specifies the number of days after which data that is not + /// accessed by clients will be tiered. /// - [JsonProperty(PropertyName = "properties.coolnessPeriod")] - public int? CoolnessPeriod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolnessPeriod")] + public int? CoolnessPeriod {get; set; } /// - /// Gets or sets UNIX permissions for NFS volume accepted in octal 4 - /// digit format. First digit selects the set user ID(4), set group ID - /// (2) and sticky (1) attributes. Second digit selects permission for - /// the owner of the file: read (4), write (2) and execute (1). Third - /// selects permissions for other users in the same group. the fourth - /// for other users not in the group. 0755 - gives read/write/execute - /// permissions to owner and read/execute to group and other users. + /// Gets or sets uNIX permissions for NFS volume accepted in octal 4 digit + /// format. First digit selects the set user ID(4), set group ID (2) and sticky + /// (1) attributes. Second digit selects permission for the owner of the file: + /// read (4), write (2) and execute (1). Third selects permissions for other + /// users in the same group. the fourth for other users not in the group. 0755 + /// - gives read/write/execute permissions to owner and read/execute to group + /// and other users. /// - [JsonProperty(PropertyName = "properties.unixPermissions")] - public string UnixPermissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.unixPermissions")] + public string UnixPermissions {get; set; } /// - /// Gets when a volume is being restored from another volume's - /// snapshot, will show the percentage completion of this cloning - /// process. When this value is empty/null there is no cloning process - /// currently happening on this volume. This value will update every 5 - /// minutes during cloning. + /// Gets when a volume is being restored from another volume's snapshot, will + /// show the percentage completion of this cloning process. When this value is + /// empty/null there is no cloning process currently happening on this volume. + /// This value will update every 5 minutes during cloning. /// - [JsonProperty(PropertyName = "properties.cloneProgress")] - public int? CloneProgress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cloneProgress")] + public int? CloneProgress {get; private set; } /// - /// Gets flag indicating whether file access logs are enabled for the - /// volume, based on active diagnostic settings present on the volume. - /// Possible values include: 'Enabled', 'Disabled' + /// Gets flag indicating whether file access logs are enabled for the volume, + /// based on active diagnostic settings present on the volume. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.fileAccessLogs")] - public string FileAccessLogs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fileAccessLogs")] + public string FileAccessLogs {get; private set; } /// - /// Gets or sets avsDataStore + /// Gets or sets specifies whether the volume is enabled for Azure VMware + /// Solution (AVS) datastore purpose Possible values include: 'Enabled', 'Disabled' /// - /// - /// Specifies whether the volume is enabled for Azure VMware Solution - /// (AVS) datastore purpose. Possible values include: 'Enabled', - /// 'Disabled' - /// - [JsonProperty(PropertyName = "properties.avsDataStore")] - public string AvsDataStore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.avsDataStore")] + public string AvsDataStore {get; set; } /// - /// Gets dataStoreResourceId + /// Gets data store resource unique identifier /// - /// - /// Data store resource unique identifier - /// - [JsonProperty(PropertyName = "properties.dataStoreResourceId")] - public IList DataStoreResourceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataStoreResourceId")] + public System.Collections.Generic.IList DataStoreResourceId {get; private set; } /// /// Gets or sets specifies if default quota is enabled for the volume. /// - [JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] - public bool? IsDefaultQuotaEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] + public bool? IsDefaultQuotaEnabled {get; set; } /// /// Gets or sets default user quota for volume in KiBs. If /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . /// - [JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] - public long? DefaultUserQuotaInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] + public long? DefaultUserQuotaInKiBs {get; set; } /// /// Gets or sets default group quota for volume in KiBs. If /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. /// - [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] - public long? DefaultGroupQuotaInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] + public long? DefaultGroupQuotaInKiBs {get; set; } /// - /// Gets maximum number of files allowed. Needs a service request in - /// order to be changed. Only allowed to be changed if volume quota is - /// more than 4TiB. + /// Gets maximum number of files allowed. Needs a service request in order to + /// be changed. Only allowed to be changed if volume quota is more than 4TiB. /// - [JsonProperty(PropertyName = "properties.maximumNumberOfFiles")] - public long? MaximumNumberOfFiles { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.maximumNumberOfFiles")] + public long? MaximumNumberOfFiles {get; private set; } /// /// Gets volume Group Name /// - [JsonProperty(PropertyName = "properties.volumeGroupName")] - public string VolumeGroupName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeGroupName")] + public string VolumeGroupName {get; private set; } /// - /// Gets or sets pool Resource Id used in case of creating a volume - /// through volume group + /// Gets or sets pool Resource Id used in case of creating a volume through + /// volume group /// - [JsonProperty(PropertyName = "properties.capacityPoolResourceId")] - public string CapacityPoolResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityPoolResourceId")] + public string CapacityPoolResourceId {get; set; } /// /// Gets or sets proximity placement group associated with the volume /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public string ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public string ProximityPlacementGroup {get; set; } /// - /// Gets T2 network information + /// Gets t2 network information /// - [JsonProperty(PropertyName = "properties.t2Network")] - public string T2Network { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.t2Network")] + public string T2Network {get; private set; } /// - /// Gets or sets volume spec name is the application specific - /// designation or identifier for the particular volume in a volume - /// group for e.g. data, log + /// Gets or sets volume spec name is the application specific designation or + /// identifier for the particular volume in a volume group for e.g. data, log /// - [JsonProperty(PropertyName = "properties.volumeSpecName")] - public string VolumeSpecName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeSpecName")] + public string VolumeSpecName {get; set; } /// - /// Gets specifies if the volume is encrypted or not. Only available on - /// volumes created or updated after 2022-01-01. + /// Gets specifies if the volume is encrypted or not. Only available on volumes + /// created or updated after 2022-01-01. /// - [JsonProperty(PropertyName = "properties.encrypted")] - public bool? Encrypted { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encrypted")] + public bool? Encrypted {get; private set; } /// - /// Gets or sets volume placement rules + /// Gets or sets application specific placement rules for the particular volume /// - /// - /// Application specific placement rules for the particular volume - /// - [JsonProperty(PropertyName = "properties.placementRules")] - public IList PlacementRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.placementRules")] + public System.Collections.Generic.IList PlacementRules {get; set; } /// - /// Gets or sets flag indicating whether subvolume operations are - /// enabled on the volume. Possible values include: 'Enabled', - /// 'Disabled' + /// Gets the availability zone where the volume is provisioned. This refers to + /// the logical availability zone where the volume resides. /// - [JsonProperty(PropertyName = "properties.enableSubvolumes")] - public string EnableSubvolumes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionedAvailabilityZone")] + public string ProvisionedAvailabilityZone {get; private set; } /// - /// Gets provisioned Availability Zone + /// Gets or sets specifies whether volume is a Large Volume or Regular Volume. /// - /// - /// The availability zone where the volume is provisioned. This refers - /// to the logical availability zone where the volume resides. - /// - [JsonProperty(PropertyName = "properties.provisionedAvailabilityZone")] - public string ProvisionedAvailabilityZone { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isLargeVolume")] + public bool? IsLargeVolume {get; set; } /// - /// Gets or sets is Large Volume + /// Gets id of the snapshot or backup that the volume is restored from. /// - /// - /// Specifies whether volume is a Large Volume or Regular Volume. - /// - [JsonProperty(PropertyName = "properties.isLargeVolume")] - public bool? IsLargeVolume { get; set; } - - /// - /// Gets originating Resource Id - /// - /// - /// Id of the snapshot or backup that the volume is restored from. - /// - [JsonProperty(PropertyName = "properties.originatingResourceId")] - public string OriginatingResourceId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.originatingResourceId")] + public string OriginatingResourceId {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (CreationToken == null) + if (this.CreationToken == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreationToken"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreationToken"); } - if (SubnetId == null) + if (this.SubnetId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SubnetId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SubnetId"); } - if (FileSystemId != null) + + + + + + + if (this.FileSystemId != null) { - if (FileSystemId.Length > 36) + if (this.FileSystemId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "FileSystemId", 36); } - if (FileSystemId.Length < 36) + if (this.FileSystemId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "FileSystemId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } - if (CreationToken != null) + if (this.CreationToken != null) { - if (CreationToken.Length > 80) + if (this.CreationToken.Length > 80) { - throw new ValidationException(ValidationRules.MaxLength, "CreationToken", 80); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "CreationToken", 80); } - if (CreationToken.Length < 1) + if (this.CreationToken.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "CreationToken", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "CreationToken", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(CreationToken, "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.CreationToken, "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$")) { - throw new ValidationException(ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); } } - if (UsageThreshold > 549755813888000) + if (this.UsageThreshold > 549755813888000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); } - if (UsageThreshold < 107374182400) + if (this.UsageThreshold < 107374182400) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } - if (NetworkSiblingSetId != null) + + + + + + + + if (this.NetworkSiblingSetId != null) { - if (NetworkSiblingSetId.Length > 36) + if (this.NetworkSiblingSetId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "NetworkSiblingSetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "NetworkSiblingSetId", 36); } - if (NetworkSiblingSetId.Length < 36) + if (this.NetworkSiblingSetId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "NetworkSiblingSetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "NetworkSiblingSetId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "NetworkSiblingSetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "NetworkSiblingSetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } - if (MountTargets != null) + + if (this.MountTargets != null) { - foreach (var element in MountTargets) + foreach (var element in this.MountTargets) { if (element != null) { @@ -766,42 +788,57 @@ public override void Validate() } } } - if (DataProtection != null) + + if (this.DataProtection != null) { - DataProtection.Validate(); + this.DataProtection.Validate(); } - if (CoolnessPeriod != null) + + + + + if (this.CoolnessPeriod != null) { - if (CoolnessPeriod > 63) + if (this.CoolnessPeriod > 63) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); } - if (CoolnessPeriod < 7) + if (this.CoolnessPeriod < 7) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } } - if (UnixPermissions != null) + if (this.UnixPermissions != null) { - if (UnixPermissions.Length > 4) + if (this.UnixPermissions.Length > 4) { - throw new ValidationException(ValidationRules.MaxLength, "UnixPermissions", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "UnixPermissions", 4); } - if (UnixPermissions.Length < 4) + if (this.UnixPermissions.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "UnixPermissions", 4); } } - if (PlacementRules != null) + + + + + + + + + if (this.PlacementRules != null) { - foreach (var element1 in PlacementRules) + foreach (var element in this.PlacementRules) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackupProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackupProperties.cs index f8cc68e2b756..84c85283b395 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackupProperties.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackupProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public VolumeBackupProperties() /// /// Initializes a new instance of the VolumeBackupProperties class. /// - /// Backup Policy Resource ID - /// Policy Enforced - /// Backup Enabled + + /// Backup Policy Resource ID + /// + + /// Policy Enforced + /// + + /// Backup Enabled + /// public VolumeBackupProperties(string backupPolicyId = default(string), bool? policyEnforced = default(bool?), bool? backupEnabled = default(bool?)) + { - BackupPolicyId = backupPolicyId; - PolicyEnforced = policyEnforced; - BackupEnabled = backupEnabled; + this.BackupPolicyId = backupPolicyId; + this.PolicyEnforced = policyEnforced; + this.BackupEnabled = backupEnabled; CustomInit(); } @@ -45,23 +46,23 @@ public VolumeBackupProperties() /// partial void CustomInit(); + /// /// Gets or sets backup Policy Resource ID /// - [JsonProperty(PropertyName = "backupPolicyId")] - public string BackupPolicyId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backupPolicyId")] + public string BackupPolicyId {get; set; } /// /// Gets or sets policy Enforced /// - [JsonProperty(PropertyName = "policyEnforced")] - public bool? PolicyEnforced { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "policyEnforced")] + public bool? PolicyEnforced {get; set; } /// /// Gets or sets backup Enabled /// - [JsonProperty(PropertyName = "backupEnabled")] - public bool? BackupEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "backupEnabled")] + public bool? BackupEnabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackups.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackups.cs index 57e2e41c689c..2513a058b0c4 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackups.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeBackups.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,15 +23,21 @@ public VolumeBackups() /// /// Initializes a new instance of the VolumeBackups class. /// - /// Volume name - /// Total count of backups for - /// volume - /// Policy enabled + + /// Volume name + /// + + /// Total count of backups for volume + /// + + /// Policy enabled + /// public VolumeBackups(string volumeName = default(string), int? backupsCount = default(int?), bool? policyEnabled = default(bool?)) + { - VolumeName = volumeName; - BackupsCount = backupsCount; - PolicyEnabled = policyEnabled; + this.VolumeName = volumeName; + this.BackupsCount = backupsCount; + this.PolicyEnabled = policyEnabled; CustomInit(); } @@ -46,23 +46,23 @@ public VolumeBackups() /// partial void CustomInit(); + /// /// Gets or sets volume name /// - [JsonProperty(PropertyName = "volumeName")] - public string VolumeName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeName")] + public string VolumeName {get; set; } /// /// Gets or sets total count of backups for volume /// - [JsonProperty(PropertyName = "backupsCount")] - public int? BackupsCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backupsCount")] + public int? BackupsCount {get; set; } /// /// Gets or sets policy enabled /// - [JsonProperty(PropertyName = "policyEnabled")] - public bool? PolicyEnabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "policyEnabled")] + public bool? PolicyEnabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroup.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroup.cs index 5fb0f33a4d30..d34bc92c5bb1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroup.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroup.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Volume group resource /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VolumeGroup { /// @@ -32,20 +24,33 @@ public VolumeGroup() /// /// Initializes a new instance of the VolumeGroup class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Azure lifecycle management - /// groupMetaData + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Azure lifecycle management + /// + + /// Volume group details + /// public VolumeGroup(string location = default(string), string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData)) + { - Location = location; - Id = id; - Name = name; - Type = type; - ProvisioningState = provisioningState; - GroupMetaData = groupMetaData; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.ProvisioningState = provisioningState; + this.GroupMetaData = groupMetaData; CustomInit(); } @@ -54,44 +59,41 @@ public VolumeGroup() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets groupMetaData + /// Gets or sets volume group details /// - /// - /// Volume group details - /// - [JsonProperty(PropertyName = "properties.groupMetaData")] - public VolumeGroupMetaData GroupMetaData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.groupMetaData")] + public VolumeGroupMetaData GroupMetaData {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupDetails.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupDetails.cs index d55db318d471..2066e4b45cb0 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupDetails.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupDetails.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Volume group resource for create /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VolumeGroupDetails { /// @@ -34,22 +24,37 @@ public VolumeGroupDetails() /// /// Initializes a new instance of the VolumeGroupDetails class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Azure lifecycle management - /// groupMetaData - /// List of volumes from group - public VolumeGroupDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData), IList volumes = default(IList)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Azure lifecycle management + /// + + /// Volume group details + /// + + /// List of volumes from group + /// + public VolumeGroupDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData), System.Collections.Generic.IList volumes = default(System.Collections.Generic.IList)) + { - Location = location; - Id = id; - Name = name; - Type = type; - ProvisioningState = provisioningState; - GroupMetaData = groupMetaData; - Volumes = volumes; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.ProvisioningState = provisioningState; + this.GroupMetaData = groupMetaData; + this.Volumes = volumes; CustomInit(); } @@ -58,50 +63,47 @@ public VolumeGroupDetails() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets azure lifecycle management /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets groupMetaData + /// Gets or sets volume group details /// - /// - /// Volume group details - /// - [JsonProperty(PropertyName = "properties.groupMetaData")] - public VolumeGroupMetaData GroupMetaData { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.groupMetaData")] + public VolumeGroupMetaData GroupMetaData {get; set; } /// /// Gets or sets list of volumes from group /// - [JsonProperty(PropertyName = "properties.volumes")] - public IList Volumes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumes")] + public System.Collections.Generic.IList Volumes {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupListProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupListProperties.cs new file mode 100644 index 000000000000..66c82082888f --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupListProperties.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.NetApp.Models +{ + using System.Linq; + + /// + /// Volume group properties + /// + public partial class VolumeGroupListProperties + { + /// + /// Initializes a new instance of the VolumeGroupListProperties class. + /// + public VolumeGroupListProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeGroupListProperties class. + /// + + /// Azure lifecycle management + /// + + /// Volume group details + /// + public VolumeGroupListProperties(string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData)) + + { + this.ProvisioningState = provisioningState; + this.GroupMetaData = groupMetaData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets volume group details + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "groupMetaData")] + public VolumeGroupMetaData GroupMetaData {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupMetaData.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupMetaData.cs index b66d6ae63b8a..dfc10d3afb9c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupMetaData.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupMetaData.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,25 +23,33 @@ public VolumeGroupMetaData() /// /// Initializes a new instance of the VolumeGroupMetaData class. /// - /// Group Description - /// Application Type. Possible values - /// include: 'SAP-HANA' - /// Application specific - /// identifier - /// Global volume placement - /// rules - /// Application specific identifier of - /// deployment rules for the volume group - /// Number of volumes in volume - /// group - public VolumeGroupMetaData(string groupDescription = default(string), string applicationType = default(string), string applicationIdentifier = default(string), IList globalPlacementRules = default(IList), string deploymentSpecId = default(string), long? volumesCount = default(long?)) + + /// Group Description + /// + + /// Application Type + /// Possible values include: 'SAP-HANA' + + /// Application specific identifier + /// + + /// Application specific placement rules for the volume group + /// + + /// Application specific identifier of deployment rules for the volume group + /// + + /// Number of volumes in volume group + /// + public VolumeGroupMetaData(string groupDescription = default(string), string applicationType = default(string), string applicationIdentifier = default(string), System.Collections.Generic.IList globalPlacementRules = default(System.Collections.Generic.IList), string deploymentSpecId = default(string), long? volumesCount = default(long?)) + { - GroupDescription = groupDescription; - ApplicationType = applicationType; - ApplicationIdentifier = applicationIdentifier; - GlobalPlacementRules = globalPlacementRules; - DeploymentSpecId = deploymentSpecId; - VolumesCount = volumesCount; + this.GroupDescription = groupDescription; + this.ApplicationType = applicationType; + this.ApplicationIdentifier = applicationIdentifier; + this.GlobalPlacementRules = globalPlacementRules; + this.DeploymentSpecId = deploymentSpecId; + this.VolumesCount = volumesCount; CustomInit(); } @@ -58,45 +58,42 @@ public VolumeGroupMetaData() /// partial void CustomInit(); + /// /// Gets or sets group Description /// - [JsonProperty(PropertyName = "groupDescription")] - public string GroupDescription { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupDescription")] + public string GroupDescription {get; set; } /// - /// Gets or sets application Type. Possible values include: 'SAP-HANA' + /// Gets or sets application Type Possible values include: 'SAP-HANA' /// - [JsonProperty(PropertyName = "applicationType")] - public string ApplicationType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationType")] + public string ApplicationType {get; set; } /// /// Gets or sets application specific identifier /// - [JsonProperty(PropertyName = "applicationIdentifier")] - public string ApplicationIdentifier { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "applicationIdentifier")] + public string ApplicationIdentifier {get; set; } /// - /// Gets or sets global volume placement rules + /// Gets or sets application specific placement rules for the volume group /// - /// - /// Application specific placement rules for the volume group - /// - [JsonProperty(PropertyName = "globalPlacementRules")] - public IList GlobalPlacementRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "globalPlacementRules")] + public System.Collections.Generic.IList GlobalPlacementRules {get; set; } /// - /// Gets or sets application specific identifier of deployment rules - /// for the volume group + /// Gets or sets application specific identifier of deployment rules for the + /// volume group /// - [JsonProperty(PropertyName = "deploymentSpecId")] - public string DeploymentSpecId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "deploymentSpecId")] + public string DeploymentSpecId {get; set; } /// /// Gets number of volumes in volume group /// - [JsonProperty(PropertyName = "volumesCount")] - public long? VolumesCount { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "volumesCount")] + public long? VolumesCount {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupProperties.cs new file mode 100644 index 000000000000..2f1b1f0f7537 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupProperties.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.NetApp.Models +{ + using System.Linq; + + /// + /// Volume group properties + /// + public partial class VolumeGroupProperties + { + /// + /// Initializes a new instance of the VolumeGroupProperties class. + /// + public VolumeGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeGroupProperties class. + /// + + /// Azure lifecycle management + /// + + /// Volume group details + /// + + /// List of volumes from group + /// + public VolumeGroupProperties(string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData), System.Collections.Generic.IList volumes = default(System.Collections.Generic.IList)) + + { + this.ProvisioningState = provisioningState; + this.GroupMetaData = groupMetaData; + this.Volumes = volumes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets volume group details + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "groupMetaData")] + public VolumeGroupMetaData GroupMetaData {get; set; } + + /// + /// Gets or sets list of volumes from group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumes")] + public System.Collections.Generic.IList Volumes {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupVolumeProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupVolumeProperties.cs index 0998be65e004..6c6e95e9a307 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupVolumeProperties.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeGroupVolumeProperties.cs @@ -1,32 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Volume resource /// - [Rest.Serialization.JsonTransformation] - public partial class VolumeGroupVolumeProperties : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VolumeGroupVolumeProperties : Microsoft.Rest.Azure.IResource { /// - /// Initializes a new instance of the VolumeGroupVolumeProperties - /// class. + /// Initializes a new instance of the VolumeGroupVolumeProperties class. /// public VolumeGroupVolumeProperties() { @@ -34,187 +22,279 @@ public VolumeGroupVolumeProperties() } /// - /// Initializes a new instance of the VolumeGroupVolumeProperties - /// class. - /// - /// Creation Token or File Path - /// usageThreshold - /// The Azure Resource URI for a delegated - /// subnet. Must have the delegation Microsoft.NetApp/volumes - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// FileSystem ID - /// serviceLevel - /// exportPolicy - /// protocolTypes - /// Azure lifecycle management - /// Snapshot ID - /// If enabled (true) the snapshot the - /// volume was created from will be automatically deleted after the - /// volume create operation has finished. Defaults to false - /// Backup ID - /// Baremetal Tenant ID - /// Network features - /// Network Sibling Set ID - /// Storage to Network - /// Proximity - /// mountTargets - /// What type of volume is this. For - /// destination volumes in Cross Region Replication, set type to - /// DataProtection - /// DataProtection - /// Restoring - /// If enabled (true) the volume - /// will contain a read-only snapshot directory which provides access - /// to each of the volume's snapshots (defaults to true). - /// Describe if a volume is - /// KerberosEnabled. To be use with swagger version 2020-05-01 or - /// later - /// The security style of volume, default - /// unix, defaults to ntfs for dual protocol or CIFS protocol. Possible - /// values include: 'ntfs', 'unix' - /// Enables encryption for in-flight smb3 - /// data. Only applicable for SMB/DualProtocol volume. To be used with - /// swagger version 2020-08-01 or later - /// smbAccessBasedEnumeration - /// smbNonBrowsable - /// Enables continuously - /// available share property for smb volume. Only applicable for SMB - /// volume - /// Maximum throughput in MiB/s that can - /// be achieved by this volume and this will be accepted as input only - /// for manual qosType volume - /// Actual throughput in MiB/s for - /// auto qosType volumes calculated based on size and - /// serviceLevel - /// Source of key used to encrypt - /// data in volume. Applicable if NetApp account has - /// encryption.keySource = 'Microsoft.KeyVault'. Possible values - /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. - /// Possible values include: 'Microsoft.NetApp', - /// 'Microsoft.KeyVault' - /// The resource ID of - /// private endpoint for KeyVault. It must reside in the same VNET as - /// the volume. Only applicable if encryptionKeySource = - /// 'Microsoft.KeyVault'. - /// Specifies whether LDAP is enabled or not - /// for a given NFS volume. - /// Specifies whether Cool Access(tiering) is - /// enabled for the volume. - /// Specifies the number of days after - /// which data that is not accessed by clients will be tiered. - /// UNIX permissions for NFS volume - /// accepted in octal 4 digit format. First digit selects the set user - /// ID(4), set group ID (2) and sticky (1) attributes. Second digit - /// selects permission for the owner of the file: read (4), write (2) - /// and execute (1). Third selects permissions for other users in the - /// same group. the fourth for other users not in the group. 0755 - - /// gives read/write/execute permissions to owner and read/execute to - /// group and other users. - /// When a volume is being restored from - /// another volume's snapshot, will show the percentage completion of - /// this cloning process. When this value is empty/null there is no - /// cloning process currently happening on this volume. This value will - /// update every 5 minutes during cloning. - /// Flag indicating whether file access - /// logs are enabled for the volume, based on active diagnostic - /// settings present on the volume. Possible values include: 'Enabled', - /// 'Disabled' - /// avsDataStore - /// dataStoreResourceId - /// Specifies if default quota is - /// enabled for the volume. - /// Default user quota for volume - /// in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 - /// KiBs applies . - /// Default group quota for - /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value - /// of 4 KiBs applies. - /// Maximum number of files allowed. - /// Needs a service request in order to be changed. Only allowed to be - /// changed if volume quota is more than 4TiB. - /// Volume Group Name - /// Pool Resource Id used in case - /// of creating a volume through volume group - /// Proximity placement group - /// associated with the volume - /// T2 network information - /// Volume spec name is the application - /// specific designation or identifier for the particular volume in a - /// volume group for e.g. data, log - /// Specifies if the volume is encrypted or - /// not. Only available on volumes created or updated after - /// 2022-01-01. - /// Volume placement rules - /// Flag indicating whether subvolume - /// operations are enabled on the volume. Possible values include: - /// 'Enabled', 'Disabled' - /// Provisioned Availability - /// Zone - /// Is Large Volume - /// Originating Resource Id - public VolumeGroupVolumeProperties(string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), double? actualThroughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string fileAccessLogs = default(string), string avsDataStore = default(string), IList dataStoreResourceId = default(IList), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), IList placementRules = default(IList), string enableSubvolumes = default(string), string provisionedAvailabilityZone = default(string), bool? isLargeVolume = default(bool?), string originatingResourceId = default(string)) + /// Initializes a new instance of the VolumeGroupVolumeProperties class. + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// Basic network, or Standard features available to the volume. + /// Possible values include: 'Basic', 'Standard' + + /// The security style of volume, default unix, defaults to ntfs for dual + /// protocol or CIFS protocol + /// Possible values include: 'ntfs', 'unix' + + /// Flag indicating whether subvolume operations are enabled on the volume + /// Possible values include: 'Enabled', 'Disabled' + + /// Unique FileSystem Identifier. + /// + + /// A unique file path for the volume. Used when creating mount targets + /// + + /// Maximum storage quota allowed for a file system in bytes. This is a soft + /// quota used for alerting only. Minimum size is 100 GiB. Upper limit is + /// 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + + /// Set of export policy rules + /// + + /// Set of protocol types, default NFSv3, CIFS for SMB protocol + /// + + /// Azure lifecycle management + /// + + /// UUID v4 or resource identifier used to identify the Snapshot. + /// + + /// If enabled (true) the snapshot the volume was created from will be + /// automatically deleted after the volume create operation has finished. + /// Defaults to false + /// + + /// UUID v4 or resource identifier used to identify the Backup. + /// + + /// Unique Baremetal Tenant Identifier. + /// + + /// The Azure Resource URI for a delegated subnet. Must have the delegation + /// Microsoft.NetApp/volumes + /// + + /// Network Sibling Set ID for the the group of volumes sharing networking + /// resources. + /// + + /// Provides storage to network proximity information for the volume. + /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' + + /// List of mount targets + /// + + /// What type of volume is this. For destination volumes in Cross Region + /// Replication, set type to DataProtection + /// + + /// DataProtection type volumes include an object containing details of the + /// replication + /// + + /// Restoring + /// + + /// If enabled (true) the volume will contain a read-only snapshot directory + /// which provides access to each of the volume's snapshots (defaults to true). + /// + + /// Describe if a volume is KerberosEnabled. To be use with swagger version + /// 2020-05-01 or later + /// + + /// Enables encryption for in-flight smb3 data. Only applicable for + /// SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + /// later + /// + + /// Enables access based enumeration share property for SMB Shares. Only + /// applicable for SMB/DualProtocol volume + /// Possible values include: 'Disabled', 'Enabled' + + /// Enables non browsable property for SMB Shares. Only applicable for + /// SMB/DualProtocol volume + /// Possible values include: 'Disabled', 'Enabled' + + /// Enables continuously available share property for smb volume. Only + /// applicable for SMB volume + /// + + /// Maximum throughput in MiB/s that can be achieved by this volume and this + /// will be accepted as input only for manual qosType volume + /// + + /// Actual throughput in MiB/s for auto qosType volumes calculated based on + /// size and serviceLevel + /// + + /// Source of key used to encrypt data in volume. Applicable if NetApp account + /// has encryption.keySource = 'Microsoft.KeyVault'. Possible values + /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault' + /// Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' + + /// The resource ID of private endpoint for KeyVault. It must reside in the + /// same VNET as the volume. Only applicable if encryptionKeySource = + /// 'Microsoft.KeyVault'. + /// + + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// + + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// + + /// Specifies the number of days after which data that is not accessed by + /// clients will be tiered. + /// + + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First + /// digit selects the set user ID(4), set group ID (2) and sticky (1) + /// attributes. Second digit selects permission for the owner of the file: read + /// (4), write (2) and execute (1). Third selects permissions for other users + /// in the same group. the fourth for other users not in the group. 0755 - + /// gives read/write/execute permissions to owner and read/execute to group and + /// other users. + /// + + /// When a volume is being restored from another volume's snapshot, will show + /// the percentage completion of this cloning process. When this value is + /// empty/null there is no cloning process currently happening on this volume. + /// This value will update every 5 minutes during cloning. + /// + + /// Flag indicating whether file access logs are enabled for the volume, based + /// on active diagnostic settings present on the volume. + /// Possible values include: 'Enabled', 'Disabled' + + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) + /// datastore purpose + /// Possible values include: 'Enabled', 'Disabled' + + /// Data store resource unique identifier + /// + + /// Specifies if default quota is enabled for the volume. + /// + + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the + /// minimum value of 4 KiBs applies . + /// + + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, + /// the minimum value of 4 KiBs applies. + /// + + /// Maximum number of files allowed. Needs a service request in order to be + /// changed. Only allowed to be changed if volume quota is more than 4TiB. + /// + + /// Volume Group Name + /// + + /// Pool Resource Id used in case of creating a volume through volume group + /// + + /// Proximity placement group associated with the volume + /// + + /// T2 network information + /// + + /// Volume spec name is the application specific designation or identifier for + /// the particular volume in a volume group for e.g. data, log + /// + + /// Specifies if the volume is encrypted or not. Only available on volumes + /// created or updated after 2022-01-01. + /// + + /// Application specific placement rules for the particular volume + /// + + /// The availability zone where the volume is provisioned. This refers to the + /// logical availability zone where the volume resides. + /// + + /// Specifies whether volume is a Large Volume or Regular Volume. + /// + + /// Id of the snapshot or backup that the volume is restored from. + /// + public VolumeGroupVolumeProperties(string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string serviceLevel = default(string), string networkFeatures = default(string), string securityStyle = default(string), string enableSubvolumes = default(string), string fileSystemId = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), System.Collections.Generic.IList protocolTypes = default(System.Collections.Generic.IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), System.Collections.Generic.IList mountTargets = default(System.Collections.Generic.IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), double? actualThroughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string fileAccessLogs = default(string), string avsDataStore = default(string), System.Collections.Generic.IList dataStoreResourceId = default(System.Collections.Generic.IList), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), System.Collections.Generic.IList placementRules = default(System.Collections.Generic.IList), string provisionedAvailabilityZone = default(string), bool? isLargeVolume = default(bool?), string originatingResourceId = default(string)) + { - Id = id; - Name = name; - Type = type; - Tags = tags; - FileSystemId = fileSystemId; - CreationToken = creationToken; - ServiceLevel = serviceLevel; - UsageThreshold = usageThreshold; - ExportPolicy = exportPolicy; - ProtocolTypes = protocolTypes; - ProvisioningState = provisioningState; - SnapshotId = snapshotId; - DeleteBaseSnapshot = deleteBaseSnapshot; - BackupId = backupId; - BaremetalTenantId = baremetalTenantId; - SubnetId = subnetId; - NetworkFeatures = networkFeatures; - NetworkSiblingSetId = networkSiblingSetId; - StorageToNetworkProximity = storageToNetworkProximity; - MountTargets = mountTargets; - VolumeType = volumeType; - DataProtection = dataProtection; - IsRestoring = isRestoring; - SnapshotDirectoryVisible = snapshotDirectoryVisible; - KerberosEnabled = kerberosEnabled; - SecurityStyle = securityStyle; - SmbEncryption = smbEncryption; - SmbAccessBasedEnumeration = smbAccessBasedEnumeration; - SmbNonBrowsable = smbNonBrowsable; - SmbContinuouslyAvailable = smbContinuouslyAvailable; - ThroughputMibps = throughputMibps; - ActualThroughputMibps = actualThroughputMibps; - EncryptionKeySource = encryptionKeySource; - KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; - LdapEnabled = ldapEnabled; - CoolAccess = coolAccess; - CoolnessPeriod = coolnessPeriod; - UnixPermissions = unixPermissions; - CloneProgress = cloneProgress; - FileAccessLogs = fileAccessLogs; - AvsDataStore = avsDataStore; - DataStoreResourceId = dataStoreResourceId; - IsDefaultQuotaEnabled = isDefaultQuotaEnabled; - DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; - DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; - MaximumNumberOfFiles = maximumNumberOfFiles; - VolumeGroupName = volumeGroupName; - CapacityPoolResourceId = capacityPoolResourceId; - ProximityPlacementGroup = proximityPlacementGroup; - T2Network = t2Network; - VolumeSpecName = volumeSpecName; - Encrypted = encrypted; - PlacementRules = placementRules; - EnableSubvolumes = enableSubvolumes; - ProvisionedAvailabilityZone = provisionedAvailabilityZone; - IsLargeVolume = isLargeVolume; - OriginatingResourceId = originatingResourceId; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.ServiceLevel = serviceLevel; + this.NetworkFeatures = networkFeatures; + this.SecurityStyle = securityStyle; + this.EnableSubvolumes = enableSubvolumes; + this.FileSystemId = fileSystemId; + this.CreationToken = creationToken; + this.UsageThreshold = usageThreshold; + this.ExportPolicy = exportPolicy; + this.ProtocolTypes = protocolTypes; + this.ProvisioningState = provisioningState; + this.SnapshotId = snapshotId; + this.DeleteBaseSnapshot = deleteBaseSnapshot; + this.BackupId = backupId; + this.BaremetalTenantId = baremetalTenantId; + this.SubnetId = subnetId; + this.NetworkSiblingSetId = networkSiblingSetId; + this.StorageToNetworkProximity = storageToNetworkProximity; + this.MountTargets = mountTargets; + this.VolumeType = volumeType; + this.DataProtection = dataProtection; + this.IsRestoring = isRestoring; + this.SnapshotDirectoryVisible = snapshotDirectoryVisible; + this.KerberosEnabled = kerberosEnabled; + this.SmbEncryption = smbEncryption; + this.SmbAccessBasedEnumeration = smbAccessBasedEnumeration; + this.SmbNonBrowsable = smbNonBrowsable; + this.SmbContinuouslyAvailable = smbContinuouslyAvailable; + this.ThroughputMibps = throughputMibps; + this.ActualThroughputMibps = actualThroughputMibps; + this.EncryptionKeySource = encryptionKeySource; + this.KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; + this.LdapEnabled = ldapEnabled; + this.CoolAccess = coolAccess; + this.CoolnessPeriod = coolnessPeriod; + this.UnixPermissions = unixPermissions; + this.CloneProgress = cloneProgress; + this.FileAccessLogs = fileAccessLogs; + this.AvsDataStore = avsDataStore; + this.DataStoreResourceId = dataStoreResourceId; + this.IsDefaultQuotaEnabled = isDefaultQuotaEnabled; + this.DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; + this.DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + this.MaximumNumberOfFiles = maximumNumberOfFiles; + this.VolumeGroupName = volumeGroupName; + this.CapacityPoolResourceId = capacityPoolResourceId; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.T2Network = t2Network; + this.VolumeSpecName = volumeSpecName; + this.Encrypted = encrypted; + this.PlacementRules = placementRules; + this.ProvisionedAvailabilityZone = provisionedAvailabilityZone; + this.IsLargeVolume = isLargeVolume; + this.OriginatingResourceId = originatingResourceId; CustomInit(); } @@ -223,546 +303,482 @@ public VolumeGroupVolumeProperties() /// partial void CustomInit(); + /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets or sets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets fileSystem ID + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' /// - /// - /// Unique FileSystem Identifier. - /// - [JsonProperty(PropertyName = "properties.fileSystemId")] - public string FileSystemId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceLevel")] + public string ServiceLevel {get; set; } /// - /// Gets or sets creation Token or File Path + /// Gets or sets basic network, or Standard features available to the volume. Possible values include: 'Basic', 'Standard' /// - /// - /// A unique file path for the volume. Used when creating mount targets - /// - [JsonProperty(PropertyName = "properties.creationToken")] - public string CreationToken { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkFeatures")] + public string NetworkFeatures {get; set; } /// - /// Gets or sets serviceLevel + /// Gets or sets the security style of volume, default unix, defaults to ntfs + /// for dual protocol or CIFS protocol Possible values include: 'ntfs', 'unix' /// - /// - /// Possible values include: 'Standard', 'Premium', 'Ultra', - /// 'StandardZRS' - /// - [JsonProperty(PropertyName = "properties.serviceLevel")] - public string ServiceLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.securityStyle")] + public string SecurityStyle {get; set; } /// - /// Gets or sets usageThreshold + /// Gets or sets flag indicating whether subvolume operations are enabled on + /// the volume Possible values include: 'Enabled', 'Disabled' /// - /// - /// Maximum storage quota allowed for a file system in bytes. This is a - /// soft quota used for alerting only. Minimum size is 100 GiB. Upper - /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. - /// - [JsonProperty(PropertyName = "properties.usageThreshold")] - public long UsageThreshold { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableSubvolumes")] + public string EnableSubvolumes {get; set; } /// - /// Gets or sets exportPolicy + /// Gets unique FileSystem Identifier. /// - /// - /// Set of export policy rules - /// - [JsonProperty(PropertyName = "properties.exportPolicy")] - public VolumePropertiesExportPolicy ExportPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fileSystemId")] + public string FileSystemId {get; private set; } /// - /// Gets or sets protocolTypes + /// Gets or sets a unique file path for the volume. Used when creating mount + /// targets /// - /// - /// Set of protocol types, default NFSv3, CIFS for SMB protocol - /// - [JsonProperty(PropertyName = "properties.protocolTypes")] - public IList ProtocolTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationToken")] + public string CreationToken {get; set; } /// - /// Gets azure lifecycle management + /// Gets or sets maximum storage quota allowed for a file system in bytes. This + /// is a soft quota used for alerting only. Minimum size is 100 GiB. Upper + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usageThreshold")] + public long UsageThreshold {get; set; } /// - /// Gets or sets snapshot ID + /// Gets or sets set of export policy rules /// - /// - /// UUID v4 or resource identifier used to identify the Snapshot. - /// - [JsonProperty(PropertyName = "properties.snapshotId")] - public string SnapshotId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.exportPolicy")] + public VolumePropertiesExportPolicy ExportPolicy {get; set; } /// - /// Gets or sets if enabled (true) the snapshot the volume was created - /// from will be automatically deleted after the volume create - /// operation has finished. Defaults to false + /// Gets or sets set of protocol types, default NFSv3, CIFS for SMB protocol /// - [JsonProperty(PropertyName = "properties.deleteBaseSnapshot")] - public bool? DeleteBaseSnapshot { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.protocolTypes")] + public System.Collections.Generic.IList ProtocolTypes {get; set; } /// - /// Gets or sets backup ID + /// Gets azure lifecycle management /// - /// - /// UUID v4 or resource identifier used to identify the Backup. - /// - [JsonProperty(PropertyName = "properties.backupId")] - public string BackupId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets baremetal Tenant ID + /// Gets or sets uUID v4 or resource identifier used to identify the Snapshot. /// - /// - /// Unique Baremetal Tenant Identifier. - /// - [JsonProperty(PropertyName = "properties.baremetalTenantId")] - public string BaremetalTenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotId")] + public string SnapshotId {get; set; } /// - /// Gets or sets the Azure Resource URI for a delegated subnet. Must - /// have the delegation Microsoft.NetApp/volumes + /// Gets or sets if enabled (true) the snapshot the volume was created from + /// will be automatically deleted after the volume create operation has + /// finished. Defaults to false /// - [JsonProperty(PropertyName = "properties.subnetId")] - public string SubnetId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deleteBaseSnapshot")] + public bool? DeleteBaseSnapshot {get; set; } /// - /// Gets or sets network features + /// Gets or sets uUID v4 or resource identifier used to identify the Backup. /// - /// - /// Basic network, or Standard features available to the volume. - /// Possible values include: 'Basic', 'Standard' - /// - [JsonProperty(PropertyName = "properties.networkFeatures")] - public string NetworkFeatures { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.backupId")] + public string BackupId {get; set; } /// - /// Gets network Sibling Set ID + /// Gets unique Baremetal Tenant Identifier. /// - /// - /// Network Sibling Set ID for the the group of volumes sharing - /// networking resources. - /// - [JsonProperty(PropertyName = "properties.networkSiblingSetId")] - public string NetworkSiblingSetId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.baremetalTenantId")] + public string BaremetalTenantId {get; private set; } /// - /// Gets storage to Network Proximity + /// Gets or sets the Azure Resource URI for a delegated subnet. Must have the + /// delegation Microsoft.NetApp/volumes /// - /// - /// Provides storage to network proximity information for the volume. - /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' - /// - [JsonProperty(PropertyName = "properties.storageToNetworkProximity")] - public string StorageToNetworkProximity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId {get; set; } /// - /// Gets mountTargets + /// Gets network Sibling Set ID for the the group of volumes sharing networking + /// resources. /// - /// - /// List of mount targets - /// - [JsonProperty(PropertyName = "properties.mountTargets")] - public IList MountTargets { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.networkSiblingSetId")] + public string NetworkSiblingSetId {get; private set; } /// - /// Gets or sets what type of volume is this. For destination volumes - /// in Cross Region Replication, set type to DataProtection + /// Gets provides storage to network proximity information for the volume. Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' /// - [JsonProperty(PropertyName = "properties.volumeType")] - public string VolumeType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageToNetworkProximity")] + public string StorageToNetworkProximity {get; private set; } /// - /// Gets or sets dataProtection + /// Gets list of mount targets /// - /// - /// DataProtection type volumes include an object containing details of - /// the replication - /// - [JsonProperty(PropertyName = "properties.dataProtection")] - public VolumePropertiesDataProtection DataProtection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.mountTargets")] + public System.Collections.Generic.IList MountTargets {get; private set; } /// - /// Gets or sets restoring + /// Gets or sets what type of volume is this. For destination volumes in Cross + /// Region Replication, set type to DataProtection /// - [JsonProperty(PropertyName = "properties.isRestoring")] - public bool? IsRestoring { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeType")] + public string VolumeType {get; set; } /// - /// Gets or sets if enabled (true) the volume will contain a read-only - /// snapshot directory which provides access to each of the volume's - /// snapshots (defaults to true). + /// Gets or sets dataProtection type volumes include an object containing + /// details of the replication /// - [JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] - public bool? SnapshotDirectoryVisible { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataProtection")] + public VolumePropertiesDataProtection DataProtection {get; set; } /// - /// Gets or sets describe if a volume is KerberosEnabled. To be use - /// with swagger version 2020-05-01 or later + /// Gets or sets restoring /// - [JsonProperty(PropertyName = "properties.kerberosEnabled")] - public bool? KerberosEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isRestoring")] + public bool? IsRestoring {get; set; } /// - /// Gets or sets the security style of volume, default unix, defaults - /// to ntfs for dual protocol or CIFS protocol. Possible values - /// include: 'ntfs', 'unix' + /// Gets or sets if enabled (true) the volume will contain a read-only snapshot + /// directory which provides access to each of the volume's snapshots (defaults + /// to true). /// - [JsonProperty(PropertyName = "properties.securityStyle")] - public string SecurityStyle { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] + public bool? SnapshotDirectoryVisible {get; set; } /// - /// Gets or sets enables encryption for in-flight smb3 data. Only - /// applicable for SMB/DualProtocol volume. To be used with swagger - /// version 2020-08-01 or later + /// Gets or sets describe if a volume is KerberosEnabled. To be use with + /// swagger version 2020-05-01 or later /// - [JsonProperty(PropertyName = "properties.smbEncryption")] - public bool? SmbEncryption { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.kerberosEnabled")] + public bool? KerberosEnabled {get; set; } /// - /// Gets or sets smbAccessBasedEnumeration + /// Gets or sets enables encryption for in-flight smb3 data. Only applicable + /// for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + /// later /// - /// - /// Enables access based enumeration share property for SMB Shares. - /// Only applicable for SMB/DualProtocol volume. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "properties.smbAccessBasedEnumeration")] - public string SmbAccessBasedEnumeration { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbEncryption")] + public bool? SmbEncryption {get; set; } /// - /// Gets or sets smbNonBrowsable + /// Gets or sets enables access based enumeration share property for SMB + /// Shares. Only applicable for SMB/DualProtocol volume Possible values include: 'Disabled', 'Enabled' /// - /// - /// Enables non browsable property for SMB Shares. Only applicable for - /// SMB/DualProtocol volume. Possible values include: 'Disabled', - /// 'Enabled' - /// - [JsonProperty(PropertyName = "properties.smbNonBrowsable")] - public string SmbNonBrowsable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbAccessBasedEnumeration")] + public string SmbAccessBasedEnumeration {get; set; } /// - /// Gets or sets enables continuously available share property for smb - /// volume. Only applicable for SMB volume + /// Gets or sets enables non browsable property for SMB Shares. Only applicable + /// for SMB/DualProtocol volume Possible values include: 'Disabled', 'Enabled' /// - [JsonProperty(PropertyName = "properties.smbContinuouslyAvailable")] - public bool? SmbContinuouslyAvailable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbNonBrowsable")] + public string SmbNonBrowsable {get; set; } /// - /// Gets or sets maximum throughput in MiB/s that can be achieved by - /// this volume and this will be accepted as input only for manual - /// qosType volume + /// Gets or sets enables continuously available share property for smb volume. + /// Only applicable for SMB volume /// - [JsonProperty(PropertyName = "properties.throughputMibps")] - public double? ThroughputMibps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smbContinuouslyAvailable")] + public bool? SmbContinuouslyAvailable {get; set; } /// - /// Gets actual throughput in MiB/s for auto qosType volumes calculated - /// based on size and serviceLevel + /// Gets or sets maximum throughput in MiB/s that can be achieved by this + /// volume and this will be accepted as input only for manual qosType volume /// - [JsonProperty(PropertyName = "properties.actualThroughputMibps")] - public double? ActualThroughputMibps { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.throughputMibps")] + public double? ThroughputMibps {get; set; } /// - /// Gets or sets source of key used to encrypt data in volume. - /// Applicable if NetApp account has encryption.keySource = - /// 'Microsoft.KeyVault'. Possible values (case-insensitive) are: - /// 'Microsoft.NetApp, Microsoft.KeyVault'. Possible values include: - /// 'Microsoft.NetApp', 'Microsoft.KeyVault' + /// Gets actual throughput in MiB/s for auto qosType volumes calculated based + /// on size and serviceLevel /// - [JsonProperty(PropertyName = "properties.encryptionKeySource")] - public string EncryptionKeySource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actualThroughputMibps")] + public double? ActualThroughputMibps {get; private set; } /// - /// Gets or sets the resource ID of private endpoint for KeyVault. It - /// must reside in the same VNET as the volume. Only applicable if - /// encryptionKeySource = 'Microsoft.KeyVault'. + /// Gets or sets source of key used to encrypt data in volume. Applicable if + /// NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible + /// values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault' Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' /// - [JsonProperty(PropertyName = "properties.keyVaultPrivateEndpointResourceId")] - public string KeyVaultPrivateEndpointResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encryptionKeySource")] + public string EncryptionKeySource {get; set; } /// - /// Gets or sets specifies whether LDAP is enabled or not for a given - /// NFS volume. + /// Gets or sets the resource ID of private endpoint for KeyVault. It must + /// reside in the same VNET as the volume. Only applicable if + /// encryptionKeySource = 'Microsoft.KeyVault'. /// - [JsonProperty(PropertyName = "properties.ldapEnabled")] - public bool? LdapEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultPrivateEndpointResourceId")] + public string KeyVaultPrivateEndpointResourceId {get; set; } /// - /// Gets or sets specifies whether Cool Access(tiering) is enabled for - /// the volume. + /// Gets or sets specifies whether LDAP is enabled or not for a given NFS + /// volume. /// - [JsonProperty(PropertyName = "properties.coolAccess")] - public bool? CoolAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ldapEnabled")] + public bool? LdapEnabled {get; set; } /// - /// Gets or sets specifies the number of days after which data that is - /// not accessed by clients will be tiered. + /// Gets or sets specifies whether Cool Access(tiering) is enabled for the + /// volume. /// - [JsonProperty(PropertyName = "properties.coolnessPeriod")] - public int? CoolnessPeriod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess {get; set; } /// - /// Gets or sets UNIX permissions for NFS volume accepted in octal 4 - /// digit format. First digit selects the set user ID(4), set group ID - /// (2) and sticky (1) attributes. Second digit selects permission for - /// the owner of the file: read (4), write (2) and execute (1). Third - /// selects permissions for other users in the same group. the fourth - /// for other users not in the group. 0755 - gives read/write/execute - /// permissions to owner and read/execute to group and other users. + /// Gets or sets specifies the number of days after which data that is not + /// accessed by clients will be tiered. /// - [JsonProperty(PropertyName = "properties.unixPermissions")] - public string UnixPermissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolnessPeriod")] + public int? CoolnessPeriod {get; set; } /// - /// Gets when a volume is being restored from another volume's - /// snapshot, will show the percentage completion of this cloning - /// process. When this value is empty/null there is no cloning process - /// currently happening on this volume. This value will update every 5 - /// minutes during cloning. + /// Gets or sets uNIX permissions for NFS volume accepted in octal 4 digit + /// format. First digit selects the set user ID(4), set group ID (2) and sticky + /// (1) attributes. Second digit selects permission for the owner of the file: + /// read (4), write (2) and execute (1). Third selects permissions for other + /// users in the same group. the fourth for other users not in the group. 0755 + /// - gives read/write/execute permissions to owner and read/execute to group + /// and other users. /// - [JsonProperty(PropertyName = "properties.cloneProgress")] - public int? CloneProgress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.unixPermissions")] + public string UnixPermissions {get; set; } /// - /// Gets flag indicating whether file access logs are enabled for the - /// volume, based on active diagnostic settings present on the volume. - /// Possible values include: 'Enabled', 'Disabled' + /// Gets when a volume is being restored from another volume's snapshot, will + /// show the percentage completion of this cloning process. When this value is + /// empty/null there is no cloning process currently happening on this volume. + /// This value will update every 5 minutes during cloning. /// - [JsonProperty(PropertyName = "properties.fileAccessLogs")] - public string FileAccessLogs { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.cloneProgress")] + public int? CloneProgress {get; private set; } /// - /// Gets or sets avsDataStore + /// Gets flag indicating whether file access logs are enabled for the volume, + /// based on active diagnostic settings present on the volume. Possible values include: 'Enabled', 'Disabled' /// - /// - /// Specifies whether the volume is enabled for Azure VMware Solution - /// (AVS) datastore purpose. Possible values include: 'Enabled', - /// 'Disabled' - /// - [JsonProperty(PropertyName = "properties.avsDataStore")] - public string AvsDataStore { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.fileAccessLogs")] + public string FileAccessLogs {get; private set; } /// - /// Gets dataStoreResourceId + /// Gets or sets specifies whether the volume is enabled for Azure VMware + /// Solution (AVS) datastore purpose Possible values include: 'Enabled', 'Disabled' /// - /// - /// Data store resource unique identifier - /// - [JsonProperty(PropertyName = "properties.dataStoreResourceId")] - public IList DataStoreResourceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.avsDataStore")] + public string AvsDataStore {get; set; } + + /// + /// Gets data store resource unique identifier + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataStoreResourceId")] + public System.Collections.Generic.IList DataStoreResourceId {get; private set; } /// /// Gets or sets specifies if default quota is enabled for the volume. /// - [JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] - public bool? IsDefaultQuotaEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] + public bool? IsDefaultQuotaEnabled {get; set; } /// /// Gets or sets default user quota for volume in KiBs. If /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . /// - [JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] - public long? DefaultUserQuotaInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] + public long? DefaultUserQuotaInKiBs {get; set; } /// /// Gets or sets default group quota for volume in KiBs. If /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. /// - [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] - public long? DefaultGroupQuotaInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] + public long? DefaultGroupQuotaInKiBs {get; set; } /// - /// Gets maximum number of files allowed. Needs a service request in - /// order to be changed. Only allowed to be changed if volume quota is - /// more than 4TiB. + /// Gets maximum number of files allowed. Needs a service request in order to + /// be changed. Only allowed to be changed if volume quota is more than 4TiB. /// - [JsonProperty(PropertyName = "properties.maximumNumberOfFiles")] - public long? MaximumNumberOfFiles { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.maximumNumberOfFiles")] + public long? MaximumNumberOfFiles {get; private set; } /// /// Gets volume Group Name /// - [JsonProperty(PropertyName = "properties.volumeGroupName")] - public string VolumeGroupName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeGroupName")] + public string VolumeGroupName {get; private set; } /// - /// Gets or sets pool Resource Id used in case of creating a volume - /// through volume group + /// Gets or sets pool Resource Id used in case of creating a volume through + /// volume group /// - [JsonProperty(PropertyName = "properties.capacityPoolResourceId")] - public string CapacityPoolResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityPoolResourceId")] + public string CapacityPoolResourceId {get; set; } /// /// Gets or sets proximity placement group associated with the volume /// - [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] - public string ProximityPlacementGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public string ProximityPlacementGroup {get; set; } /// - /// Gets T2 network information + /// Gets t2 network information /// - [JsonProperty(PropertyName = "properties.t2Network")] - public string T2Network { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.t2Network")] + public string T2Network {get; private set; } /// - /// Gets or sets volume spec name is the application specific - /// designation or identifier for the particular volume in a volume - /// group for e.g. data, log + /// Gets or sets volume spec name is the application specific designation or + /// identifier for the particular volume in a volume group for e.g. data, log /// - [JsonProperty(PropertyName = "properties.volumeSpecName")] - public string VolumeSpecName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.volumeSpecName")] + public string VolumeSpecName {get; set; } /// - /// Gets specifies if the volume is encrypted or not. Only available on - /// volumes created or updated after 2022-01-01. + /// Gets specifies if the volume is encrypted or not. Only available on volumes + /// created or updated after 2022-01-01. /// - [JsonProperty(PropertyName = "properties.encrypted")] - public bool? Encrypted { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.encrypted")] + public bool? Encrypted {get; private set; } /// - /// Gets or sets volume placement rules + /// Gets or sets application specific placement rules for the particular volume /// - /// - /// Application specific placement rules for the particular volume - /// - [JsonProperty(PropertyName = "properties.placementRules")] - public IList PlacementRules { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.placementRules")] + public System.Collections.Generic.IList PlacementRules {get; set; } /// - /// Gets or sets flag indicating whether subvolume operations are - /// enabled on the volume. Possible values include: 'Enabled', - /// 'Disabled' + /// Gets the availability zone where the volume is provisioned. This refers to + /// the logical availability zone where the volume resides. /// - [JsonProperty(PropertyName = "properties.enableSubvolumes")] - public string EnableSubvolumes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisionedAvailabilityZone")] + public string ProvisionedAvailabilityZone {get; private set; } /// - /// Gets provisioned Availability Zone + /// Gets or sets specifies whether volume is a Large Volume or Regular Volume. /// - /// - /// The availability zone where the volume is provisioned. This refers - /// to the logical availability zone where the volume resides. - /// - [JsonProperty(PropertyName = "properties.provisionedAvailabilityZone")] - public string ProvisionedAvailabilityZone { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isLargeVolume")] + public bool? IsLargeVolume {get; set; } /// - /// Gets or sets is Large Volume + /// Gets id of the snapshot or backup that the volume is restored from. /// - /// - /// Specifies whether volume is a Large Volume or Regular Volume. - /// - [JsonProperty(PropertyName = "properties.isLargeVolume")] - public bool? IsLargeVolume { get; set; } - - /// - /// Gets originating Resource Id - /// - /// - /// Id of the snapshot or backup that the volume is restored from. - /// - [JsonProperty(PropertyName = "properties.originatingResourceId")] - public string OriginatingResourceId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.originatingResourceId")] + public string OriginatingResourceId {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (CreationToken == null) + if (this.CreationToken == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "CreationToken"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreationToken"); } - if (SubnetId == null) + if (this.SubnetId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SubnetId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SubnetId"); } - if (FileSystemId != null) + + + + + + + + + if (this.FileSystemId != null) { - if (FileSystemId.Length > 36) + if (this.FileSystemId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "FileSystemId", 36); } - if (FileSystemId.Length < 36) + if (this.FileSystemId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "FileSystemId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "FileSystemId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } - if (CreationToken != null) + if (this.CreationToken != null) { - if (CreationToken.Length > 80) + if (this.CreationToken.Length > 80) { - throw new ValidationException(ValidationRules.MaxLength, "CreationToken", 80); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "CreationToken", 80); } - if (CreationToken.Length < 1) + if (this.CreationToken.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "CreationToken", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "CreationToken", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(CreationToken, "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.CreationToken, "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$")) { - throw new ValidationException(ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); } } - if (UsageThreshold > 549755813888000) + if (this.UsageThreshold > 549755813888000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); } - if (UsageThreshold < 107374182400) + if (this.UsageThreshold < 107374182400) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } - if (NetworkSiblingSetId != null) + + + + + + + + if (this.NetworkSiblingSetId != null) { - if (NetworkSiblingSetId.Length > 36) + if (this.NetworkSiblingSetId.Length > 36) { - throw new ValidationException(ValidationRules.MaxLength, "NetworkSiblingSetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "NetworkSiblingSetId", 36); } - if (NetworkSiblingSetId.Length < 36) + if (this.NetworkSiblingSetId.Length < 36) { - throw new ValidationException(ValidationRules.MinLength, "NetworkSiblingSetId", 36); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "NetworkSiblingSetId", 36); } - if (!System.Text.RegularExpressions.Regex.IsMatch(NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) { - throw new ValidationException(ValidationRules.Pattern, "NetworkSiblingSetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "NetworkSiblingSetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); } } - if (MountTargets != null) + + if (this.MountTargets != null) { - foreach (var element in MountTargets) + foreach (var element in this.MountTargets) { if (element != null) { @@ -770,42 +786,57 @@ public virtual void Validate() } } } - if (DataProtection != null) + + if (this.DataProtection != null) { - DataProtection.Validate(); + this.DataProtection.Validate(); } - if (CoolnessPeriod != null) + + + + + if (this.CoolnessPeriod != null) { - if (CoolnessPeriod > 63) + if (this.CoolnessPeriod > 63) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); } - if (CoolnessPeriod < 7) + if (this.CoolnessPeriod < 7) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } } - if (UnixPermissions != null) + if (this.UnixPermissions != null) { - if (UnixPermissions.Length > 4) + if (this.UnixPermissions.Length > 4) { - throw new ValidationException(ValidationRules.MaxLength, "UnixPermissions", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "UnixPermissions", 4); } - if (UnixPermissions.Length < 4) + if (this.UnixPermissions.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "UnixPermissions", 4); } } - if (PlacementRules != null) + + + + + + + + + if (this.PlacementRules != null) { - foreach (var element1 in PlacementRules) + foreach (var element in this.PlacementRules) { - if (element1 != null) + if (element != null) { - element1.Validate(); + element.Validate(); } } } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatch.cs index b53ddedde5d0..64dcd4cb9a25 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatch.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Volume patch resource /// - [Rest.Serialization.JsonTransformation] - public partial class VolumePatch : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class VolumePatch : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the VolumePatch class. @@ -35,60 +24,91 @@ public VolumePatch() /// /// Initializes a new instance of the VolumePatch class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// serviceLevel - /// usageThreshold - /// exportPolicy - /// Maximum throughput in MiB/s that can - /// be achieved by this volume and this will be accepted as input only - /// for manual qosType volume - /// DataProtection - /// Specifies if default quota is - /// enabled for the volume. - /// Default user quota for volume - /// in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 - /// KiBs applies . - /// Default group quota for - /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value - /// of 4 KiBs applies. - /// UNIX permissions for NFS volume - /// accepted in octal 4 digit format. First digit selects the set user - /// ID(4), set group ID (2) and sticky (1) attributes. Second digit - /// selects permission for the owner of the file: read (4), write (2) - /// and execute (1). Third selects permissions for other users in the - /// same group. the fourth for other users not in the group. 0755 - - /// gives read/write/execute permissions to owner and read/execute to - /// group and other users. - /// Specifies whether Cool Access(tiering) is - /// enabled for the volume. - /// Specifies the number of days after - /// which data that is not accessed by clients will be tiered. - /// If enabled (true) the volume - /// will contain a read-only snapshot directory which provides access - /// to each of the volume's snapshots. - public VolumePatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string serviceLevel = default(string), long? usageThreshold = default(long?), VolumePatchPropertiesExportPolicy exportPolicy = default(VolumePatchPropertiesExportPolicy), double? throughputMibps = default(double?), VolumePatchPropertiesDataProtection dataProtection = default(VolumePatchPropertiesDataProtection), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = default(string), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), bool? snapshotDirectoryVisible = default(bool?)) + + /// Resource location + /// + + /// Resource Id + /// + + /// Resource name + /// + + /// Resource type + /// + + /// Resource tags + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// Maximum storage quota allowed for a file system in bytes. This is a soft + /// quota used for alerting only. Minimum size is 100 GiB. Upper limit is + /// 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + + /// Set of export policy rules + /// + + /// Maximum throughput in MiB/s that can be achieved by this volume and this + /// will be accepted as input only for manual qosType volume + /// + + /// DataProtection type volumes include an object containing details of the + /// replication + /// + + /// Specifies if default quota is enabled for the volume. + /// + + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the + /// minimum value of 4 KiBs applies . + /// + + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, + /// the minimum value of 4 KiBs applies. + /// + + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First + /// digit selects the set user ID(4), set group ID (2) and sticky (1) + /// attributes. Second digit selects permission for the owner of the file: read + /// (4), write (2) and execute (1). Third selects permissions for other users + /// in the same group. the fourth for other users not in the group. 0755 - + /// gives read/write/execute permissions to owner and read/execute to group and + /// other users. + /// + + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// + + /// Specifies the number of days after which data that is not accessed by + /// clients will be tiered. + /// + + /// If enabled (true) the volume will contain a read-only snapshot directory + /// which provides access to each of the volume's snapshots. + /// + public VolumePatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string serviceLevel = default(string), long? usageThreshold = default(long?), VolumePatchPropertiesExportPolicy exportPolicy = default(VolumePatchPropertiesExportPolicy), double? throughputMibps = default(double?), VolumePatchPropertiesDataProtection dataProtection = default(VolumePatchPropertiesDataProtection), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = default(string), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), bool? snapshotDirectoryVisible = default(bool?)) + { - Location = location; - Id = id; - Name = name; - Type = type; - Tags = tags; - ServiceLevel = serviceLevel; - UsageThreshold = usageThreshold; - ExportPolicy = exportPolicy; - ThroughputMibps = throughputMibps; - DataProtection = dataProtection; - IsDefaultQuotaEnabled = isDefaultQuotaEnabled; - DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; - DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; - UnixPermissions = unixPermissions; - CoolAccess = coolAccess; - CoolnessPeriod = coolnessPeriod; - SnapshotDirectoryVisible = snapshotDirectoryVisible; + this.Location = location; + this.Id = id; + this.Name = name; + this.Type = type; + this.Tags = tags; + this.ServiceLevel = serviceLevel; + this.UsageThreshold = usageThreshold; + this.ExportPolicy = exportPolicy; + this.ThroughputMibps = throughputMibps; + this.DataProtection = dataProtection; + this.IsDefaultQuotaEnabled = isDefaultQuotaEnabled; + this.DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; + this.DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + this.UnixPermissions = unixPermissions; + this.CoolAccess = coolAccess; + this.CoolnessPeriod = coolnessPeriod; + this.SnapshotDirectoryVisible = snapshotDirectoryVisible; CustomInit(); } @@ -97,179 +117,172 @@ public VolumePatch() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// /// Gets resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets serviceLevel + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' /// - /// - /// Possible values include: 'Standard', 'Premium', 'Ultra', - /// 'StandardZRS' - /// - [JsonProperty(PropertyName = "properties.serviceLevel")] - public string ServiceLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceLevel")] + public string ServiceLevel {get; set; } /// - /// Gets or sets usageThreshold - /// - /// - /// Maximum storage quota allowed for a file system in bytes. This is a - /// soft quota used for alerting only. Minimum size is 100 GiB. Upper + /// Gets or sets maximum storage quota allowed for a file system in bytes. This + /// is a soft quota used for alerting only. Minimum size is 100 GiB. Upper /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. - /// - [JsonProperty(PropertyName = "properties.usageThreshold")] - public long? UsageThreshold { get; set; } + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.usageThreshold")] + public long? UsageThreshold {get; set; } /// - /// Gets or sets exportPolicy + /// Gets or sets set of export policy rules /// - /// - /// Set of export policy rules - /// - [JsonProperty(PropertyName = "properties.exportPolicy")] - public VolumePatchPropertiesExportPolicy ExportPolicy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.exportPolicy")] + public VolumePatchPropertiesExportPolicy ExportPolicy {get; set; } /// - /// Gets or sets maximum throughput in MiB/s that can be achieved by - /// this volume and this will be accepted as input only for manual - /// qosType volume + /// Gets or sets maximum throughput in MiB/s that can be achieved by this + /// volume and this will be accepted as input only for manual qosType volume /// - [JsonProperty(PropertyName = "properties.throughputMibps")] - public double? ThroughputMibps { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.throughputMibps")] + public double? ThroughputMibps {get; set; } /// - /// Gets or sets dataProtection + /// Gets or sets dataProtection type volumes include an object containing + /// details of the replication /// - /// - /// DataProtection type volumes include an object containing details of - /// the replication - /// - [JsonProperty(PropertyName = "properties.dataProtection")] - public VolumePatchPropertiesDataProtection DataProtection { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataProtection")] + public VolumePatchPropertiesDataProtection DataProtection {get; set; } /// /// Gets or sets specifies if default quota is enabled for the volume. /// - [JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] - public bool? IsDefaultQuotaEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] + public bool? IsDefaultQuotaEnabled {get; set; } /// /// Gets or sets default user quota for volume in KiBs. If /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . /// - [JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] - public long? DefaultUserQuotaInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] + public long? DefaultUserQuotaInKiBs {get; set; } /// /// Gets or sets default group quota for volume in KiBs. If /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. /// - [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] - public long? DefaultGroupQuotaInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] + public long? DefaultGroupQuotaInKiBs {get; set; } /// - /// Gets or sets UNIX permissions for NFS volume accepted in octal 4 - /// digit format. First digit selects the set user ID(4), set group ID - /// (2) and sticky (1) attributes. Second digit selects permission for - /// the owner of the file: read (4), write (2) and execute (1). Third - /// selects permissions for other users in the same group. the fourth - /// for other users not in the group. 0755 - gives read/write/execute - /// permissions to owner and read/execute to group and other users. + /// Gets or sets uNIX permissions for NFS volume accepted in octal 4 digit + /// format. First digit selects the set user ID(4), set group ID (2) and sticky + /// (1) attributes. Second digit selects permission for the owner of the file: + /// read (4), write (2) and execute (1). Third selects permissions for other + /// users in the same group. the fourth for other users not in the group. 0755 + /// - gives read/write/execute permissions to owner and read/execute to group + /// and other users. /// - [JsonProperty(PropertyName = "properties.unixPermissions")] - public string UnixPermissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.unixPermissions")] + public string UnixPermissions {get; set; } /// - /// Gets or sets specifies whether Cool Access(tiering) is enabled for - /// the volume. + /// Gets or sets specifies whether Cool Access(tiering) is enabled for the + /// volume. /// - [JsonProperty(PropertyName = "properties.coolAccess")] - public bool? CoolAccess { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess {get; set; } /// - /// Gets or sets specifies the number of days after which data that is - /// not accessed by clients will be tiered. + /// Gets or sets specifies the number of days after which data that is not + /// accessed by clients will be tiered. /// - [JsonProperty(PropertyName = "properties.coolnessPeriod")] - public int? CoolnessPeriod { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coolnessPeriod")] + public int? CoolnessPeriod {get; set; } /// - /// Gets or sets if enabled (true) the volume will contain a read-only - /// snapshot directory which provides access to each of the volume's - /// snapshots. + /// Gets or sets if enabled (true) the volume will contain a read-only snapshot + /// directory which provides access to each of the volume's snapshots. /// - [JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] - public bool? SnapshotDirectoryVisible { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] + public bool? SnapshotDirectoryVisible {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (UsageThreshold != null) + + + + + + + if (this.UsageThreshold != null) { - if (UsageThreshold > 549755813888000) + if (this.UsageThreshold > 549755813888000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); } - if (UsageThreshold < 107374182400) + if (this.UsageThreshold < 107374182400) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } } - if (UnixPermissions != null) + + + if (this.UnixPermissions != null) { - if (UnixPermissions.Length > 4) + if (this.UnixPermissions.Length > 4) { - throw new ValidationException(ValidationRules.MaxLength, "UnixPermissions", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "UnixPermissions", 4); } - if (UnixPermissions.Length < 4) + if (this.UnixPermissions.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "UnixPermissions", 4); } } - if (CoolnessPeriod != null) + if (this.CoolnessPeriod != null) { - if (CoolnessPeriod > 63) + if (this.CoolnessPeriod > 63) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); } - if (CoolnessPeriod < 7) + if (this.CoolnessPeriod < 7) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } } } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchProperties.cs new file mode 100644 index 000000000000..c254163a3f38 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchProperties.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Patchable volume properties + /// + public partial class VolumePatchProperties + { + /// + /// Initializes a new instance of the VolumePatchProperties class. + /// + public VolumePatchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumePatchProperties class. + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// Maximum storage quota allowed for a file system in bytes. This is a soft + /// quota used for alerting only. Minimum size is 100 GiB. Upper limit is + /// 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + + /// Set of export policy rules + /// + + /// Maximum throughput in MiB/s that can be achieved by this volume and this + /// will be accepted as input only for manual qosType volume + /// + + /// DataProtection type volumes include an object containing details of the + /// replication + /// + + /// Specifies if default quota is enabled for the volume. + /// + + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the + /// minimum value of 4 KiBs applies . + /// + + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, + /// the minimum value of 4 KiBs applies. + /// + + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First + /// digit selects the set user ID(4), set group ID (2) and sticky (1) + /// attributes. Second digit selects permission for the owner of the file: read + /// (4), write (2) and execute (1). Third selects permissions for other users + /// in the same group. the fourth for other users not in the group. 0755 - + /// gives read/write/execute permissions to owner and read/execute to group and + /// other users. + /// + + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// + + /// Specifies the number of days after which data that is not accessed by + /// clients will be tiered. + /// + + /// If enabled (true) the volume will contain a read-only snapshot directory + /// which provides access to each of the volume's snapshots. + /// + public VolumePatchProperties(string serviceLevel = default(string), long? usageThreshold = default(long?), VolumePatchPropertiesExportPolicy exportPolicy = default(VolumePatchPropertiesExportPolicy), double? throughputMibps = default(double?), VolumePatchPropertiesDataProtection dataProtection = default(VolumePatchPropertiesDataProtection), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = default(string), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), bool? snapshotDirectoryVisible = default(bool?)) + + { + this.ServiceLevel = serviceLevel; + this.UsageThreshold = usageThreshold; + this.ExportPolicy = exportPolicy; + this.ThroughputMibps = throughputMibps; + this.DataProtection = dataProtection; + this.IsDefaultQuotaEnabled = isDefaultQuotaEnabled; + this.DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; + this.DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + this.UnixPermissions = unixPermissions; + this.CoolAccess = coolAccess; + this.CoolnessPeriod = coolnessPeriod; + this.SnapshotDirectoryVisible = snapshotDirectoryVisible; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceLevel")] + public string ServiceLevel {get; set; } + + /// + /// Gets or sets maximum storage quota allowed for a file system in bytes. This + /// is a soft quota used for alerting only. Minimum size is 100 GiB. Upper + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usageThreshold")] + public long? UsageThreshold {get; set; } + + /// + /// Gets or sets set of export policy rules + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "exportPolicy")] + public VolumePatchPropertiesExportPolicy ExportPolicy {get; set; } + + /// + /// Gets or sets maximum throughput in MiB/s that can be achieved by this + /// volume and this will be accepted as input only for manual qosType volume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "throughputMibps")] + public double? ThroughputMibps {get; set; } + + /// + /// Gets or sets dataProtection type volumes include an object containing + /// details of the replication + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataProtection")] + public VolumePatchPropertiesDataProtection DataProtection {get; set; } + + /// + /// Gets or sets specifies if default quota is enabled for the volume. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDefaultQuotaEnabled")] + public bool? IsDefaultQuotaEnabled {get; set; } + + /// + /// Gets or sets default user quota for volume in KiBs. If + /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultUserQuotaInKiBs")] + public long? DefaultUserQuotaInKiBs {get; set; } + + /// + /// Gets or sets default group quota for volume in KiBs. If + /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultGroupQuotaInKiBs")] + public long? DefaultGroupQuotaInKiBs {get; set; } + + /// + /// Gets or sets uNIX permissions for NFS volume accepted in octal 4 digit + /// format. First digit selects the set user ID(4), set group ID (2) and sticky + /// (1) attributes. Second digit selects permission for the owner of the file: + /// read (4), write (2) and execute (1). Third selects permissions for other + /// users in the same group. the fourth for other users not in the group. 0755 + /// - gives read/write/execute permissions to owner and read/execute to group + /// and other users. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unixPermissions")] + public string UnixPermissions {get; set; } + + /// + /// Gets or sets specifies whether Cool Access(tiering) is enabled for the + /// volume. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coolAccess")] + public bool? CoolAccess {get; set; } + + /// + /// Gets or sets specifies the number of days after which data that is not + /// accessed by clients will be tiered. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coolnessPeriod")] + public int? CoolnessPeriod {get; set; } + + /// + /// Gets or sets if enabled (true) the volume will contain a read-only snapshot + /// directory which provides access to each of the volume's snapshots. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotDirectoryVisible")] + public bool? SnapshotDirectoryVisible {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + if (this.UsageThreshold != null) + { + if (this.UsageThreshold > 549755813888000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); + } + if (this.UsageThreshold < 107374182400) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + } + } + + + if (this.UnixPermissions != null) + { + if (this.UnixPermissions.Length > 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "UnixPermissions", 4); + } + if (this.UnixPermissions.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "UnixPermissions", 4); + } + } + if (this.CoolnessPeriod != null) + { + if (this.CoolnessPeriod > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (this.CoolnessPeriod < 7) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + } + } + } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesDataProtection.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesDataProtection.cs index 29b3dd50f1da..4de45aecd321 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesDataProtection.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesDataProtection.cs @@ -1,20 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// - /// DataProtection + /// DataProtection type volumes include an object containing details of the + /// replication /// /// /// DataProtection type volumes include an object containing details of the @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.NetApp.Models public partial class VolumePatchPropertiesDataProtection { /// - /// Initializes a new instance of the - /// VolumePatchPropertiesDataProtection class. + /// Initializes a new instance of the VolumePatchPropertiesDataProtection class. /// public VolumePatchPropertiesDataProtection() { @@ -32,15 +26,19 @@ public VolumePatchPropertiesDataProtection() } /// - /// Initializes a new instance of the - /// VolumePatchPropertiesDataProtection class. + /// Initializes a new instance of the VolumePatchPropertiesDataProtection class. /// - /// Backup - /// Snapshot + + /// Backup Properties + /// + + /// Snapshot properties. + /// public VolumePatchPropertiesDataProtection(VolumeBackupProperties backup = default(VolumeBackupProperties), VolumeSnapshotProperties snapshot = default(VolumeSnapshotProperties)) + { - Backup = backup; - Snapshot = snapshot; + this.Backup = backup; + this.Snapshot = snapshot; CustomInit(); } @@ -49,23 +47,17 @@ public VolumePatchPropertiesDataProtection() /// partial void CustomInit(); + /// - /// Gets or sets backup + /// Gets or sets backup Properties /// - /// - /// Backup Properties - /// - [JsonProperty(PropertyName = "backup")] - public VolumeBackupProperties Backup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backup")] + public VolumeBackupProperties Backup {get; set; } /// - /// Gets or sets snapshot + /// Gets or sets snapshot properties. /// - /// - /// Snapshot properties. - /// - [JsonProperty(PropertyName = "snapshot")] - public VolumeSnapshotProperties Snapshot { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshot")] + public VolumeSnapshotProperties Snapshot {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesExportPolicy.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesExportPolicy.cs index 0cf702e0433b..3bc600fd3f3d 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesExportPolicy.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePatchPropertiesExportPolicy.cs @@ -1,22 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// exportPolicy + /// Set of export policy rules /// /// /// Set of export policy rules @@ -24,8 +16,7 @@ namespace Microsoft.Azure.Management.NetApp.Models public partial class VolumePatchPropertiesExportPolicy { /// - /// Initializes a new instance of the VolumePatchPropertiesExportPolicy - /// class. + /// Initializes a new instance of the VolumePatchPropertiesExportPolicy class. /// public VolumePatchPropertiesExportPolicy() { @@ -33,13 +24,15 @@ public VolumePatchPropertiesExportPolicy() } /// - /// Initializes a new instance of the VolumePatchPropertiesExportPolicy - /// class. + /// Initializes a new instance of the VolumePatchPropertiesExportPolicy class. /// - /// Export policy rule - public VolumePatchPropertiesExportPolicy(IList rules = default(IList)) + + /// Export policy rule + /// + public VolumePatchPropertiesExportPolicy(System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + { - Rules = rules; + this.Rules = rules; CustomInit(); } @@ -48,14 +41,11 @@ public VolumePatchPropertiesExportPolicy() /// partial void CustomInit(); + /// /// Gets or sets export policy rule /// - /// - /// Export policy rule - /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeProperties.cs new file mode 100644 index 000000000000..6c4309587b90 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeProperties.cs @@ -0,0 +1,797 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Volume properties + /// + public partial class VolumeProperties + { + /// + /// Initializes a new instance of the VolumeProperties class. + /// + public VolumeProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeProperties class. + /// + + /// Unique FileSystem Identifier. + /// + + /// A unique file path for the volume. Used when creating mount targets + /// + + /// The service level of the file system + /// Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + + /// Maximum storage quota allowed for a file system in bytes. This is a soft + /// quota used for alerting only. Minimum size is 100 GiB. Upper limit is + /// 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + + /// Set of export policy rules + /// + + /// Set of protocol types, default NFSv3, CIFS for SMB protocol + /// + + /// Azure lifecycle management + /// + + /// UUID v4 or resource identifier used to identify the Snapshot. + /// + + /// If enabled (true) the snapshot the volume was created from will be + /// automatically deleted after the volume create operation has finished. + /// Defaults to false + /// + + /// UUID v4 or resource identifier used to identify the Backup. + /// + + /// Unique Baremetal Tenant Identifier. + /// + + /// The Azure Resource URI for a delegated subnet. Must have the delegation + /// Microsoft.NetApp/volumes + /// + + /// Basic network, or Standard features available to the volume. + /// Possible values include: 'Basic', 'Standard' + + /// Network Sibling Set ID for the the group of volumes sharing networking + /// resources. + /// + + /// Provides storage to network proximity information for the volume. + /// Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' + + /// List of mount targets + /// + + /// What type of volume is this. For destination volumes in Cross Region + /// Replication, set type to DataProtection + /// + + /// DataProtection type volumes include an object containing details of the + /// replication + /// + + /// Restoring + /// + + /// If enabled (true) the volume will contain a read-only snapshot directory + /// which provides access to each of the volume's snapshots (defaults to true). + /// + + /// Describe if a volume is KerberosEnabled. To be use with swagger version + /// 2020-05-01 or later + /// + + /// The security style of volume, default unix, defaults to ntfs for dual + /// protocol or CIFS protocol + /// Possible values include: 'ntfs', 'unix' + + /// Enables encryption for in-flight smb3 data. Only applicable for + /// SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + /// later + /// + + /// Enables access based enumeration share property for SMB Shares. Only + /// applicable for SMB/DualProtocol volume + /// Possible values include: 'Disabled', 'Enabled' + + /// Enables non browsable property for SMB Shares. Only applicable for + /// SMB/DualProtocol volume + /// Possible values include: 'Disabled', 'Enabled' + + /// Enables continuously available share property for smb volume. Only + /// applicable for SMB volume + /// + + /// Maximum throughput in MiB/s that can be achieved by this volume and this + /// will be accepted as input only for manual qosType volume + /// + + /// Actual throughput in MiB/s for auto qosType volumes calculated based on + /// size and serviceLevel + /// + + /// Source of key used to encrypt data in volume. Applicable if NetApp account + /// has encryption.keySource = 'Microsoft.KeyVault'. Possible values + /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault' + /// Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' + + /// The resource ID of private endpoint for KeyVault. It must reside in the + /// same VNET as the volume. Only applicable if encryptionKeySource = + /// 'Microsoft.KeyVault'. + /// + + /// Specifies whether LDAP is enabled or not for a given NFS volume. + /// + + /// Specifies whether Cool Access(tiering) is enabled for the volume. + /// + + /// Specifies the number of days after which data that is not accessed by + /// clients will be tiered. + /// + + /// UNIX permissions for NFS volume accepted in octal 4 digit format. First + /// digit selects the set user ID(4), set group ID (2) and sticky (1) + /// attributes. Second digit selects permission for the owner of the file: read + /// (4), write (2) and execute (1). Third selects permissions for other users + /// in the same group. the fourth for other users not in the group. 0755 - + /// gives read/write/execute permissions to owner and read/execute to group and + /// other users. + /// + + /// When a volume is being restored from another volume's snapshot, will show + /// the percentage completion of this cloning process. When this value is + /// empty/null there is no cloning process currently happening on this volume. + /// This value will update every 5 minutes during cloning. + /// + + /// Flag indicating whether file access logs are enabled for the volume, based + /// on active diagnostic settings present on the volume. + /// Possible values include: 'Enabled', 'Disabled' + + /// Specifies whether the volume is enabled for Azure VMware Solution (AVS) + /// datastore purpose + /// Possible values include: 'Enabled', 'Disabled' + + /// Data store resource unique identifier + /// + + /// Specifies if default quota is enabled for the volume. + /// + + /// Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the + /// minimum value of 4 KiBs applies . + /// + + /// Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, + /// the minimum value of 4 KiBs applies. + /// + + /// Maximum number of files allowed. Needs a service request in order to be + /// changed. Only allowed to be changed if volume quota is more than 4TiB. + /// + + /// Volume Group Name + /// + + /// Pool Resource Id used in case of creating a volume through volume group + /// + + /// Proximity placement group associated with the volume + /// + + /// T2 network information + /// + + /// Volume spec name is the application specific designation or identifier for + /// the particular volume in a volume group for e.g. data, log + /// + + /// Specifies if the volume is encrypted or not. Only available on volumes + /// created or updated after 2022-01-01. + /// + + /// Application specific placement rules for the particular volume + /// + + /// Flag indicating whether subvolume operations are enabled on the volume + /// Possible values include: 'Enabled', 'Disabled' + + /// The availability zone where the volume is provisioned. This refers to the + /// logical availability zone where the volume resides. + /// + + /// Specifies whether volume is a Large Volume or Regular Volume. + /// + + /// Id of the snapshot or backup that the volume is restored from. + /// + public VolumeProperties(string creationToken, long usageThreshold, string subnetId, string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), System.Collections.Generic.IList protocolTypes = default(System.Collections.Generic.IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), System.Collections.Generic.IList mountTargets = default(System.Collections.Generic.IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), double? actualThroughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string fileAccessLogs = default(string), string avsDataStore = default(string), System.Collections.Generic.IList dataStoreResourceId = default(System.Collections.Generic.IList), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), System.Collections.Generic.IList placementRules = default(System.Collections.Generic.IList), string enableSubvolumes = default(string), string provisionedAvailabilityZone = default(string), bool? isLargeVolume = default(bool?), string originatingResourceId = default(string)) + + { + this.FileSystemId = fileSystemId; + this.CreationToken = creationToken; + this.ServiceLevel = serviceLevel; + this.UsageThreshold = usageThreshold; + this.ExportPolicy = exportPolicy; + this.ProtocolTypes = protocolTypes; + this.ProvisioningState = provisioningState; + this.SnapshotId = snapshotId; + this.DeleteBaseSnapshot = deleteBaseSnapshot; + this.BackupId = backupId; + this.BaremetalTenantId = baremetalTenantId; + this.SubnetId = subnetId; + this.NetworkFeatures = networkFeatures; + this.NetworkSiblingSetId = networkSiblingSetId; + this.StorageToNetworkProximity = storageToNetworkProximity; + this.MountTargets = mountTargets; + this.VolumeType = volumeType; + this.DataProtection = dataProtection; + this.IsRestoring = isRestoring; + this.SnapshotDirectoryVisible = snapshotDirectoryVisible; + this.KerberosEnabled = kerberosEnabled; + this.SecurityStyle = securityStyle; + this.SmbEncryption = smbEncryption; + this.SmbAccessBasedEnumeration = smbAccessBasedEnumeration; + this.SmbNonBrowsable = smbNonBrowsable; + this.SmbContinuouslyAvailable = smbContinuouslyAvailable; + this.ThroughputMibps = throughputMibps; + this.ActualThroughputMibps = actualThroughputMibps; + this.EncryptionKeySource = encryptionKeySource; + this.KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; + this.LdapEnabled = ldapEnabled; + this.CoolAccess = coolAccess; + this.CoolnessPeriod = coolnessPeriod; + this.UnixPermissions = unixPermissions; + this.CloneProgress = cloneProgress; + this.FileAccessLogs = fileAccessLogs; + this.AvsDataStore = avsDataStore; + this.DataStoreResourceId = dataStoreResourceId; + this.IsDefaultQuotaEnabled = isDefaultQuotaEnabled; + this.DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; + this.DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + this.MaximumNumberOfFiles = maximumNumberOfFiles; + this.VolumeGroupName = volumeGroupName; + this.CapacityPoolResourceId = capacityPoolResourceId; + this.ProximityPlacementGroup = proximityPlacementGroup; + this.T2Network = t2Network; + this.VolumeSpecName = volumeSpecName; + this.Encrypted = encrypted; + this.PlacementRules = placementRules; + this.EnableSubvolumes = enableSubvolumes; + this.ProvisionedAvailabilityZone = provisionedAvailabilityZone; + this.IsLargeVolume = isLargeVolume; + this.OriginatingResourceId = originatingResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets unique FileSystem Identifier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fileSystemId")] + public string FileSystemId {get; private set; } + + /// + /// Gets or sets a unique file path for the volume. Used when creating mount + /// targets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "creationToken")] + public string CreationToken {get; set; } + + /// + /// Gets or sets the service level of the file system Possible values include: 'Standard', 'Premium', 'Ultra', 'StandardZRS' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceLevel")] + public string ServiceLevel {get; set; } + + /// + /// Gets or sets maximum storage quota allowed for a file system in bytes. This + /// is a soft quota used for alerting only. Minimum size is 100 GiB. Upper + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "usageThreshold")] + public long UsageThreshold {get; set; } + + /// + /// Gets or sets set of export policy rules + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "exportPolicy")] + public VolumePropertiesExportPolicy ExportPolicy {get; set; } + + /// + /// Gets or sets set of protocol types, default NFSv3, CIFS for SMB protocol + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "protocolTypes")] + public System.Collections.Generic.IList ProtocolTypes {get; set; } + + /// + /// Gets azure lifecycle management + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets uUID v4 or resource identifier used to identify the Snapshot. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotId")] + public string SnapshotId {get; set; } + + /// + /// Gets or sets if enabled (true) the snapshot the volume was created from + /// will be automatically deleted after the volume create operation has + /// finished. Defaults to false + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deleteBaseSnapshot")] + public bool? DeleteBaseSnapshot {get; set; } + + /// + /// Gets or sets uUID v4 or resource identifier used to identify the Backup. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backupId")] + public string BackupId {get; set; } + + /// + /// Gets unique Baremetal Tenant Identifier. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "baremetalTenantId")] + public string BaremetalTenantId {get; private set; } + + /// + /// Gets or sets the Azure Resource URI for a delegated subnet. Must have the + /// delegation Microsoft.NetApp/volumes + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subnetId")] + public string SubnetId {get; set; } + + /// + /// Gets or sets basic network, or Standard features available to the volume. Possible values include: 'Basic', 'Standard' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkFeatures")] + public string NetworkFeatures {get; set; } + + /// + /// Gets network Sibling Set ID for the the group of volumes sharing networking + /// resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "networkSiblingSetId")] + public string NetworkSiblingSetId {get; private set; } + + /// + /// Gets provides storage to network proximity information for the volume. Possible values include: 'Default', 'T1', 'T2', 'AcrossT2' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageToNetworkProximity")] + public string StorageToNetworkProximity {get; private set; } + + /// + /// Gets list of mount targets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "mountTargets")] + public System.Collections.Generic.IList MountTargets {get; private set; } + + /// + /// Gets or sets what type of volume is this. For destination volumes in Cross + /// Region Replication, set type to DataProtection + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeType")] + public string VolumeType {get; set; } + + /// + /// Gets or sets dataProtection type volumes include an object containing + /// details of the replication + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataProtection")] + public VolumePropertiesDataProtection DataProtection {get; set; } + + /// + /// Gets or sets restoring + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isRestoring")] + public bool? IsRestoring {get; set; } + + /// + /// Gets or sets if enabled (true) the volume will contain a read-only snapshot + /// directory which provides access to each of the volume's snapshots (defaults + /// to true). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotDirectoryVisible")] + public bool? SnapshotDirectoryVisible {get; set; } + + /// + /// Gets or sets describe if a volume is KerberosEnabled. To be use with + /// swagger version 2020-05-01 or later + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "kerberosEnabled")] + public bool? KerberosEnabled {get; set; } + + /// + /// Gets or sets the security style of volume, default unix, defaults to ntfs + /// for dual protocol or CIFS protocol Possible values include: 'ntfs', 'unix' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "securityStyle")] + public string SecurityStyle {get; set; } + + /// + /// Gets or sets enables encryption for in-flight smb3 data. Only applicable + /// for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + /// later + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "smbEncryption")] + public bool? SmbEncryption {get; set; } + + /// + /// Gets or sets enables access based enumeration share property for SMB + /// Shares. Only applicable for SMB/DualProtocol volume Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "smbAccessBasedEnumeration")] + public string SmbAccessBasedEnumeration {get; set; } + + /// + /// Gets or sets enables non browsable property for SMB Shares. Only applicable + /// for SMB/DualProtocol volume Possible values include: 'Disabled', 'Enabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "smbNonBrowsable")] + public string SmbNonBrowsable {get; set; } + + /// + /// Gets or sets enables continuously available share property for smb volume. + /// Only applicable for SMB volume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "smbContinuouslyAvailable")] + public bool? SmbContinuouslyAvailable {get; set; } + + /// + /// Gets or sets maximum throughput in MiB/s that can be achieved by this + /// volume and this will be accepted as input only for manual qosType volume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "throughputMibps")] + public double? ThroughputMibps {get; set; } + + /// + /// Gets actual throughput in MiB/s for auto qosType volumes calculated based + /// on size and serviceLevel + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "actualThroughputMibps")] + public double? ActualThroughputMibps {get; private set; } + + /// + /// Gets or sets source of key used to encrypt data in volume. Applicable if + /// NetApp account has encryption.keySource = 'Microsoft.KeyVault'. Possible + /// values (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault' Possible values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionKeySource")] + public string EncryptionKeySource {get; set; } + + /// + /// Gets or sets the resource ID of private endpoint for KeyVault. It must + /// reside in the same VNET as the volume. Only applicable if + /// encryptionKeySource = 'Microsoft.KeyVault'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultPrivateEndpointResourceId")] + public string KeyVaultPrivateEndpointResourceId {get; set; } + + /// + /// Gets or sets specifies whether LDAP is enabled or not for a given NFS + /// volume. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ldapEnabled")] + public bool? LdapEnabled {get; set; } + + /// + /// Gets or sets specifies whether Cool Access(tiering) is enabled for the + /// volume. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coolAccess")] + public bool? CoolAccess {get; set; } + + /// + /// Gets or sets specifies the number of days after which data that is not + /// accessed by clients will be tiered. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "coolnessPeriod")] + public int? CoolnessPeriod {get; set; } + + /// + /// Gets or sets uNIX permissions for NFS volume accepted in octal 4 digit + /// format. First digit selects the set user ID(4), set group ID (2) and sticky + /// (1) attributes. Second digit selects permission for the owner of the file: + /// read (4), write (2) and execute (1). Third selects permissions for other + /// users in the same group. the fourth for other users not in the group. 0755 + /// - gives read/write/execute permissions to owner and read/execute to group + /// and other users. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unixPermissions")] + public string UnixPermissions {get; set; } + + /// + /// Gets when a volume is being restored from another volume's snapshot, will + /// show the percentage completion of this cloning process. When this value is + /// empty/null there is no cloning process currently happening on this volume. + /// This value will update every 5 minutes during cloning. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cloneProgress")] + public int? CloneProgress {get; private set; } + + /// + /// Gets flag indicating whether file access logs are enabled for the volume, + /// based on active diagnostic settings present on the volume. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fileAccessLogs")] + public string FileAccessLogs {get; private set; } + + /// + /// Gets or sets specifies whether the volume is enabled for Azure VMware + /// Solution (AVS) datastore purpose Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "avsDataStore")] + public string AvsDataStore {get; set; } + + /// + /// Gets data store resource unique identifier + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataStoreResourceId")] + public System.Collections.Generic.IList DataStoreResourceId {get; private set; } + + /// + /// Gets or sets specifies if default quota is enabled for the volume. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDefaultQuotaEnabled")] + public bool? IsDefaultQuotaEnabled {get; set; } + + /// + /// Gets or sets default user quota for volume in KiBs. If + /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultUserQuotaInKiBs")] + public long? DefaultUserQuotaInKiBs {get; set; } + + /// + /// Gets or sets default group quota for volume in KiBs. If + /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultGroupQuotaInKiBs")] + public long? DefaultGroupQuotaInKiBs {get; set; } + + /// + /// Gets maximum number of files allowed. Needs a service request in order to + /// be changed. Only allowed to be changed if volume quota is more than 4TiB. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maximumNumberOfFiles")] + public long? MaximumNumberOfFiles {get; private set; } + + /// + /// Gets volume Group Name + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeGroupName")] + public string VolumeGroupName {get; private set; } + + /// + /// Gets or sets pool Resource Id used in case of creating a volume through + /// volume group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityPoolResourceId")] + public string CapacityPoolResourceId {get; set; } + + /// + /// Gets or sets proximity placement group associated with the volume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "proximityPlacementGroup")] + public string ProximityPlacementGroup {get; set; } + + /// + /// Gets t2 network information + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "t2Network")] + public string T2Network {get; private set; } + + /// + /// Gets or sets volume spec name is the application specific designation or + /// identifier for the particular volume in a volume group for e.g. data, log + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeSpecName")] + public string VolumeSpecName {get; set; } + + /// + /// Gets specifies if the volume is encrypted or not. Only available on volumes + /// created or updated after 2022-01-01. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encrypted")] + public bool? Encrypted {get; private set; } + + /// + /// Gets or sets application specific placement rules for the particular volume + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "placementRules")] + public System.Collections.Generic.IList PlacementRules {get; set; } + + /// + /// Gets or sets flag indicating whether subvolume operations are enabled on + /// the volume Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enableSubvolumes")] + public string EnableSubvolumes {get; set; } + + /// + /// Gets the availability zone where the volume is provisioned. This refers to + /// the logical availability zone where the volume resides. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisionedAvailabilityZone")] + public string ProvisionedAvailabilityZone {get; private set; } + + /// + /// Gets or sets specifies whether volume is a Large Volume or Regular Volume. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isLargeVolume")] + public bool? IsLargeVolume {get; set; } + + /// + /// Gets id of the snapshot or backup that the volume is restored from. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "originatingResourceId")] + public string OriginatingResourceId {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.CreationToken == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "CreationToken"); + } + if (this.SubnetId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "SubnetId"); + } + if (this.FileSystemId != null) + { + if (this.FileSystemId.Length > 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "FileSystemId", 36); + } + if (this.FileSystemId.Length < 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "FileSystemId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(this.FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "FileSystemId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } + if (this.CreationToken != null) + { + if (this.CreationToken.Length > 80) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "CreationToken", 80); + } + if (this.CreationToken.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "CreationToken", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(this.CreationToken, "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); + } + } + + if (this.UsageThreshold > 549755813888000) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); + } + if (this.UsageThreshold < 107374182400) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + } + + + + + + + + + if (this.NetworkSiblingSetId != null) + { + if (this.NetworkSiblingSetId.Length > 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "NetworkSiblingSetId", 36); + } + if (this.NetworkSiblingSetId.Length < 36) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "NetworkSiblingSetId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(this.NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "NetworkSiblingSetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } + + if (this.MountTargets != null) + { + foreach (var element in this.MountTargets) + { + if (element != null) + { + element.Validate(); + } + } + } + + if (this.DataProtection != null) + { + this.DataProtection.Validate(); + } + + + + + + if (this.CoolnessPeriod != null) + { + if (this.CoolnessPeriod > 63) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (this.CoolnessPeriod < 7) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + } + } + if (this.UnixPermissions != null) + { + if (this.UnixPermissions.Length > 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "UnixPermissions", 4); + } + if (this.UnixPermissions.Length < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "UnixPermissions", 4); + } + } + + + + + + + + + if (this.PlacementRules != null) + { + foreach (var element in this.PlacementRules) + { + if (element != null) + { + element.Validate(); + } + } + } + + + + } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesDataProtection.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesDataProtection.cs index dbd5cb9042a2..54c18d0b1edc 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesDataProtection.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesDataProtection.cs @@ -1,20 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// - /// DataProtection + /// DataProtection type volumes include an object containing details of the + /// replication /// /// /// DataProtection type volumes include an object containing details of the @@ -23,8 +18,7 @@ namespace Microsoft.Azure.Management.NetApp.Models public partial class VolumePropertiesDataProtection { /// - /// Initializes a new instance of the VolumePropertiesDataProtection - /// class. + /// Initializes a new instance of the VolumePropertiesDataProtection class. /// public VolumePropertiesDataProtection() { @@ -32,19 +26,27 @@ public VolumePropertiesDataProtection() } /// - /// Initializes a new instance of the VolumePropertiesDataProtection - /// class. + /// Initializes a new instance of the VolumePropertiesDataProtection class. /// - /// Backup - /// Replication - /// Snapshot - /// VolumeRelocation + + /// Backup Properties + /// + + /// Replication properties + /// + + /// Snapshot properties. + /// + + /// VolumeRelocation properties + /// public VolumePropertiesDataProtection(VolumeBackupProperties backup = default(VolumeBackupProperties), ReplicationObject replication = default(ReplicationObject), VolumeSnapshotProperties snapshot = default(VolumeSnapshotProperties), VolumeRelocationProperties volumeRelocation = default(VolumeRelocationProperties)) + { - Backup = backup; - Replication = replication; - Snapshot = snapshot; - VolumeRelocation = volumeRelocation; + this.Backup = backup; + this.Replication = replication; + this.Snapshot = snapshot; + this.VolumeRelocation = volumeRelocation; CustomInit(); } @@ -53,54 +55,45 @@ public VolumePropertiesDataProtection() /// partial void CustomInit(); + /// - /// Gets or sets backup + /// Gets or sets backup Properties /// - /// - /// Backup Properties - /// - [JsonProperty(PropertyName = "backup")] - public VolumeBackupProperties Backup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "backup")] + public VolumeBackupProperties Backup {get; set; } /// - /// Gets or sets replication + /// Gets or sets replication properties /// - /// - /// Replication properties - /// - [JsonProperty(PropertyName = "replication")] - public ReplicationObject Replication { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "replication")] + public ReplicationObject Replication {get; set; } /// - /// Gets or sets snapshot + /// Gets or sets snapshot properties. /// - /// - /// Snapshot properties. - /// - [JsonProperty(PropertyName = "snapshot")] - public VolumeSnapshotProperties Snapshot { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshot")] + public VolumeSnapshotProperties Snapshot {get; set; } /// - /// Gets or sets volumeRelocation + /// Gets or sets volumeRelocation properties /// - /// - /// VolumeRelocation properties - /// - [JsonProperty(PropertyName = "volumeRelocation")] - public VolumeRelocationProperties VolumeRelocation { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "volumeRelocation")] + public VolumeRelocationProperties VolumeRelocation {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Replication != null) + + if (this.Replication != null) { - Replication.Validate(); + this.Replication.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesExportPolicy.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesExportPolicy.cs index bb0a976f92fe..266c91b92604 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesExportPolicy.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumePropertiesExportPolicy.cs @@ -1,22 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// exportPolicy + /// Set of export policy rules /// /// /// Set of export policy rules @@ -24,8 +16,7 @@ namespace Microsoft.Azure.Management.NetApp.Models public partial class VolumePropertiesExportPolicy { /// - /// Initializes a new instance of the VolumePropertiesExportPolicy - /// class. + /// Initializes a new instance of the VolumePropertiesExportPolicy class. /// public VolumePropertiesExportPolicy() { @@ -33,13 +24,15 @@ public VolumePropertiesExportPolicy() } /// - /// Initializes a new instance of the VolumePropertiesExportPolicy - /// class. + /// Initializes a new instance of the VolumePropertiesExportPolicy class. /// - /// Export policy rule - public VolumePropertiesExportPolicy(IList rules = default(IList)) + + /// Export policy rule + /// + public VolumePropertiesExportPolicy(System.Collections.Generic.IList rules = default(System.Collections.Generic.IList)) + { - Rules = rules; + this.Rules = rules; CustomInit(); } @@ -48,14 +41,11 @@ public VolumePropertiesExportPolicy() /// partial void CustomInit(); + /// /// Gets or sets export policy rule /// - /// - /// Export policy rule - /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRule.cs index 007e6c09e1ed..e4f8e81cfb8e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRule.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Quota Rule of a Volume /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VolumeQuotaRule : TrackedResource { /// @@ -34,34 +24,52 @@ public VolumeQuotaRule() /// /// Initializes a new instance of the VolumeQuotaRule class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Azure Resource Manager metadata containing - /// createdBy and modifiedBy information. - /// Resource tags. - /// Possible values include: - /// 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', - /// 'Succeeded' - /// Size of quota - /// quotaType - /// UserID/GroupID/SID based on the quota - /// target type. UserID and groupID can be found by running ‘id’ or - /// ‘getent’ command for the user or group and SID can be found by - /// running <wmic useraccount where name='user-name' get - /// sid> - public VolumeQuotaRule(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) - : base(location, id, name, type, systemData, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Gets the status of the VolumeQuotaRule at the time the operation was + /// called. + /// Possible values include: 'Accepted', 'Creating', 'Patching', 'Deleting', + /// 'Moving', 'Failed', 'Succeeded' + + /// Size of quota + /// + + /// Type of quota + /// Possible values include: 'DefaultUserQuota', 'DefaultGroupQuota', + /// 'IndividualUserQuota', 'IndividualGroupQuota' + + /// UserID/GroupID/SID based on the quota target type. UserID and groupID can + /// be found by running ‘id’ or ‘getent’ command for the user or group and SID + /// can be found by running <wmic useraccount where name='user-name' get sid> + /// + public VolumeQuotaRule(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) + + : base(location, id, name, type, systemData, tags) { - ProvisioningState = provisioningState; - QuotaSizeInKiBs = quotaSizeInKiBs; - QuotaType = quotaType; - QuotaTarget = quotaTarget; + this.ProvisioningState = provisioningState; + this.QuotaSizeInKiBs = quotaSizeInKiBs; + this.QuotaType = quotaType; + this.QuotaTarget = quotaTarget; CustomInit(); } @@ -70,47 +78,46 @@ public VolumeQuotaRule() /// partial void CustomInit(); + /// - /// Gets or sets possible values include: 'Accepted', 'Creating', - /// 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' + /// Gets gets the status of the VolumeQuotaRule at the time the operation was + /// called. Possible values include: 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState {get; private set; } /// /// Gets or sets size of quota /// - [JsonProperty(PropertyName = "properties.quotaSizeInKiBs")] - public long? QuotaSizeInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.quotaSizeInKiBs")] + public long? QuotaSizeInKiBs {get; set; } /// - /// Gets or sets quotaType + /// Gets or sets type of quota Possible values include: 'DefaultUserQuota', 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' /// - /// - /// Type of quota. Possible values include: 'DefaultUserQuota', - /// 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' - /// - [JsonProperty(PropertyName = "properties.quotaType")] - public string QuotaType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.quotaType")] + public string QuotaType {get; set; } /// - /// Gets or sets userID/GroupID/SID based on the quota target type. - /// UserID and groupID can be found by running ‘id’ or ‘getent’ command - /// for the user or group and SID can be found by running &lt;wmic - /// useraccount where name='user-name' get sid&gt; + /// Gets or sets userID/GroupID/SID based on the quota target type. UserID and + /// groupID can be found by running ‘id’ or ‘getent’ command for the user or + /// group and SID can be found by running <wmic useraccount where + /// name='user-name' get sid> /// - [JsonProperty(PropertyName = "properties.quotaTarget")] - public string QuotaTarget { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.quotaTarget")] + public string QuotaTarget {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulePatch.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulePatch.cs index 9fa896f7b435..6c2f6aaf2501 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulePatch.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulePatch.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Patchable Quota Rule of a Volume /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class VolumeQuotaRulePatch { /// @@ -34,24 +24,34 @@ public VolumeQuotaRulePatch() /// /// Initializes a new instance of the VolumeQuotaRulePatch class. /// - /// Resource tags - /// Possible values include: - /// 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', - /// 'Succeeded' - /// Size of quota - /// quotaType - /// UserID/GroupID/SID based on the quota - /// target type. UserID and groupID can be found by running ‘id’ or - /// ‘getent’ command for the user or group and SID can be found by - /// running <wmic useraccount where name='user-name' get - /// sid> - public VolumeQuotaRulePatch(IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) + + /// Resource tags + /// + + /// Gets the status of the VolumeQuotaRule at the time the operation was + /// called. + /// Possible values include: 'Accepted', 'Creating', 'Patching', 'Deleting', + /// 'Moving', 'Failed', 'Succeeded' + + /// Size of quota + /// + + /// Type of quota + /// Possible values include: 'DefaultUserQuota', 'DefaultGroupQuota', + /// 'IndividualUserQuota', 'IndividualGroupQuota' + + /// UserID/GroupID/SID based on the quota target type. UserID and groupID can + /// be found by running ‘id’ or ‘getent’ command for the user or group and SID + /// can be found by running <wmic useraccount where name='user-name' get sid> + /// + public VolumeQuotaRulePatch(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) + { - Tags = tags; - ProvisioningState = provisioningState; - QuotaSizeInKiBs = quotaSizeInKiBs; - QuotaType = quotaType; - QuotaTarget = quotaTarget; + this.Tags = tags; + this.ProvisioningState = provisioningState; + this.QuotaSizeInKiBs = quotaSizeInKiBs; + this.QuotaType = quotaType; + this.QuotaTarget = quotaTarget; CustomInit(); } @@ -60,43 +60,39 @@ public VolumeQuotaRulePatch() /// partial void CustomInit(); + /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets possible values include: 'Accepted', 'Creating', - /// 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' + /// Gets gets the status of the VolumeQuotaRule at the time the operation was + /// called. Possible values include: 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState {get; private set; } /// /// Gets or sets size of quota /// - [JsonProperty(PropertyName = "properties.quotaSizeInKiBs")] - public long? QuotaSizeInKiBs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.quotaSizeInKiBs")] + public long? QuotaSizeInKiBs {get; set; } /// - /// Gets or sets quotaType + /// Gets or sets type of quota Possible values include: 'DefaultUserQuota', 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' /// - /// - /// Type of quota. Possible values include: 'DefaultUserQuota', - /// 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' - /// - [JsonProperty(PropertyName = "properties.quotaType")] - public string QuotaType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.quotaType")] + public string QuotaType {get; set; } /// - /// Gets or sets userID/GroupID/SID based on the quota target type. - /// UserID and groupID can be found by running ‘id’ or ‘getent’ command - /// for the user or group and SID can be found by running &lt;wmic - /// useraccount where name='user-name' get sid&gt; + /// Gets or sets userID/GroupID/SID based on the quota target type. UserID and + /// groupID can be found by running ‘id’ or ‘getent’ command for the user or + /// group and SID can be found by running <wmic useraccount where + /// name='user-name' get sid> /// - [JsonProperty(PropertyName = "properties.quotaTarget")] - public string QuotaTarget { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.quotaTarget")] + public string QuotaTarget {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulesProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulesProperties.cs new file mode 100644 index 000000000000..81157e5397d2 --- /dev/null +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeQuotaRulesProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Volume Quota Rule properties + /// + public partial class VolumeQuotaRulesProperties + { + /// + /// Initializes a new instance of the VolumeQuotaRulesProperties class. + /// + public VolumeQuotaRulesProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeQuotaRulesProperties class. + /// + + /// Gets the status of the VolumeQuotaRule at the time the operation was + /// called. + /// Possible values include: 'Accepted', 'Creating', 'Patching', 'Deleting', + /// 'Moving', 'Failed', 'Succeeded' + + /// Size of quota + /// + + /// Type of quota + /// Possible values include: 'DefaultUserQuota', 'DefaultGroupQuota', + /// 'IndividualUserQuota', 'IndividualGroupQuota' + + /// UserID/GroupID/SID based on the quota target type. UserID and groupID can + /// be found by running ‘id’ or ‘getent’ command for the user or group and SID + /// can be found by running <wmic useraccount where name='user-name' get sid> + /// + public VolumeQuotaRulesProperties(ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) + + { + this.ProvisioningState = provisioningState; + this.QuotaSizeInKiBs = quotaSizeInKiBs; + this.QuotaType = quotaType; + this.QuotaTarget = quotaTarget; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets gets the status of the VolumeQuotaRule at the time the operation was + /// called. Possible values include: 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public ProvisioningState? ProvisioningState {get; private set; } + + /// + /// Gets or sets size of quota + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaSizeInKiBs")] + public long? QuotaSizeInKiBs {get; set; } + + /// + /// Gets or sets type of quota Possible values include: 'DefaultUserQuota', 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaType")] + public string QuotaType {get; set; } + + /// + /// Gets or sets userID/GroupID/SID based on the quota target type. UserID and + /// groupID can be found by running ‘id’ or ‘getent’ command for the user or + /// group and SID can be found by running <wmic useraccount where + /// name='user-name' get sid> + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaTarget")] + public string QuotaTarget {get; set; } + } +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRelocationProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRelocationProperties.cs index 72d677c7134f..c7d76bd94e3f 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRelocationProperties.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRelocationProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public VolumeRelocationProperties() /// /// Initializes a new instance of the VolumeRelocationProperties class. /// - /// Has relocation been requested for - /// this volume - /// Has relocation finished and is - /// ready to be cleaned up + + /// Has relocation been requested for this volume + /// + + /// Has relocation finished and is ready to be cleaned up + /// public VolumeRelocationProperties(bool? relocationRequested = default(bool?), bool? readyToBeFinalized = default(bool?)) + { - RelocationRequested = relocationRequested; - ReadyToBeFinalized = readyToBeFinalized; + this.RelocationRequested = relocationRequested; + this.ReadyToBeFinalized = readyToBeFinalized; CustomInit(); } @@ -45,17 +42,17 @@ public VolumeRelocationProperties() /// partial void CustomInit(); + /// /// Gets or sets has relocation been requested for this volume /// - [JsonProperty(PropertyName = "relocationRequested")] - public bool? RelocationRequested { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "relocationRequested")] + public bool? RelocationRequested {get; set; } /// /// Gets has relocation finished and is ready to be cleaned up /// - [JsonProperty(PropertyName = "readyToBeFinalized")] - public bool? ReadyToBeFinalized { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "readyToBeFinalized")] + public bool? ReadyToBeFinalized {get; private set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRevert.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRevert.cs index 5c2462e74d54..84be1a06a69e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRevert.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeRevert.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public VolumeRevert() /// /// Initializes a new instance of the VolumeRevert class. /// - /// Resource id of the snapshot + + /// Resource id of the snapshot + /// public VolumeRevert(string snapshotId = default(string)) + { - SnapshotId = snapshotId; + this.SnapshotId = snapshotId; CustomInit(); } @@ -41,11 +38,11 @@ public VolumeRevert() /// partial void CustomInit(); + /// /// Gets or sets resource id of the snapshot /// - [JsonProperty(PropertyName = "snapshotId")] - public string SnapshotId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotId")] + public string SnapshotId {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeSnapshotProperties.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeSnapshotProperties.cs index ba4d09b779fc..a2c0b0a23ca3 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeSnapshotProperties.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeSnapshotProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,10 +23,13 @@ public VolumeSnapshotProperties() /// /// Initializes a new instance of the VolumeSnapshotProperties class. /// - /// Snapshot Policy ResourceId + + /// Snapshot Policy ResourceId + /// public VolumeSnapshotProperties(string snapshotPolicyId = default(string)) + { - SnapshotPolicyId = snapshotPolicyId; + this.SnapshotPolicyId = snapshotPolicyId; CustomInit(); } @@ -41,11 +38,11 @@ public VolumeSnapshotProperties() /// partial void CustomInit(); + /// /// Gets or sets snapshot Policy ResourceId /// - [JsonProperty(PropertyName = "snapshotPolicyId")] - public string SnapshotPolicyId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotPolicyId")] + public string SnapshotPolicyId {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeStorageToNetworkProximity.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeStorageToNetworkProximity.cs index aaead5d7ee8d..366edcf6a9e2 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeStorageToNetworkProximity.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumeStorageToNetworkProximity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.NetApp.Models /// /// Defines values for VolumeStorageToNetworkProximity. /// + + public static class VolumeStorageToNetworkProximity { /// @@ -33,4 +30,4 @@ public static class VolumeStorageToNetworkProximity /// public const string AcrossT2 = "AcrossT2"; } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesBreakFileLocksHeaders.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesBreakFileLocksHeaders.cs index 44c19f1ab1fa..d5606c7a1730 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesBreakFileLocksHeaders.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesBreakFileLocksHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for BreakFileLocks operation. - /// public partial class VolumesBreakFileLocksHeaders { /// - /// Initializes a new instance of the VolumesBreakFileLocksHeaders - /// class. + /// Initializes a new instance of the VolumesBreakFileLocksHeaders class. /// public VolumesBreakFileLocksHeaders() { @@ -28,12 +18,15 @@ public VolumesBreakFileLocksHeaders() } /// - /// Initializes a new instance of the VolumesBreakFileLocksHeaders - /// class. + /// Initializes a new instance of the VolumesBreakFileLocksHeaders class. /// + + /// + /// public VolumesBreakFileLocksHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public VolumesBreakFileLocksHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesListGetGroupIdListForLdapUserHeaders.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesListGetGroupIdListForLdapUserHeaders.cs index fdb69f35fa1f..76b02caa0fc9 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesListGetGroupIdListForLdapUserHeaders.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/VolumesListGetGroupIdListForLdapUserHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ListGetGroupIdListForLdapUser operation. - /// public partial class VolumesListGetGroupIdListForLdapUserHeaders { /// - /// Initializes a new instance of the - /// VolumesListGetGroupIdListForLdapUserHeaders class. + /// Initializes a new instance of the VolumesListGetGroupIdListForLdapUserHeaders class. /// public VolumesListGetGroupIdListForLdapUserHeaders() { @@ -28,12 +18,15 @@ public VolumesListGetGroupIdListForLdapUserHeaders() } /// - /// Initializes a new instance of the - /// VolumesListGetGroupIdListForLdapUserHeaders class. + /// Initializes a new instance of the VolumesListGetGroupIdListForLdapUserHeaders class. /// + + /// + /// public VolumesListGetGroupIdListForLdapUserHeaders(string location = default(string)) + { - Location = location; + this.Location = location; CustomInit(); } @@ -42,10 +35,11 @@ public VolumesListGetGroupIdListForLdapUserHeaders() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/WeeklySchedule.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/WeeklySchedule.cs index 3ba5678550d7..0cbf164c6e07 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/WeeklySchedule.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Models/WeeklySchedule.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Weekly Schedule properties, make a snapshot every week at a specific - /// day or days + /// Weekly Schedule properties, make a snapshot every week at a specific day or + /// days /// public partial class WeeklySchedule { @@ -30,23 +24,30 @@ public WeeklySchedule() /// /// Initializes a new instance of the WeeklySchedule class. /// - /// Weekly snapshot count to keep - /// Indicates which weekdays snapshot should be - /// taken, accepts a comma separated list of week day names in - /// english - /// Indicates which hour in UTC timezone a snapshot - /// should be taken - /// Indicates which minute snapshot should be - /// taken - /// Resource size in bytes, current storage - /// usage for the volume in bytes + + /// Weekly snapshot count to keep + /// + + /// Indicates which weekdays snapshot should be taken, accepts a comma + /// separated list of week day names in english + /// + + /// Indicates which hour in UTC timezone a snapshot should be taken + /// + + /// Indicates which minute snapshot should be taken + /// + + /// Resource size in bytes, current storage usage for the volume in bytes + /// public WeeklySchedule(int? snapshotsToKeep = default(int?), string day = default(string), int? hour = default(int?), int? minute = default(int?), long? usedBytes = default(long?)) + { - SnapshotsToKeep = snapshotsToKeep; - Day = day; - Hour = hour; - Minute = minute; - UsedBytes = usedBytes; + this.SnapshotsToKeep = snapshotsToKeep; + this.Day = day; + this.Hour = hour; + this.Minute = minute; + this.UsedBytes = usedBytes; CustomInit(); } @@ -55,38 +56,38 @@ public WeeklySchedule() /// partial void CustomInit(); + /// /// Gets or sets weekly snapshot count to keep /// - [JsonProperty(PropertyName = "snapshotsToKeep")] - public int? SnapshotsToKeep { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotsToKeep")] + public int? SnapshotsToKeep {get; set; } /// - /// Gets or sets indicates which weekdays snapshot should be taken, - /// accepts a comma separated list of week day names in english + /// Gets or sets indicates which weekdays snapshot should be taken, accepts a + /// comma separated list of week day names in english /// - [JsonProperty(PropertyName = "day")] - public string Day { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "day")] + public string Day {get; set; } /// - /// Gets or sets indicates which hour in UTC timezone a snapshot should - /// be taken + /// Gets or sets indicates which hour in UTC timezone a snapshot should be + /// taken /// - [JsonProperty(PropertyName = "hour")] - public int? Hour { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "hour")] + public int? Hour {get; set; } /// /// Gets or sets indicates which minute snapshot should be taken /// - [JsonProperty(PropertyName = "minute")] - public int? Minute { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minute")] + public int? Minute {get; set; } /// - /// Gets or sets resource size in bytes, current storage usage for the - /// volume in bytes + /// Gets or sets resource size in bytes, current storage usage for the volume + /// in bytes /// - [JsonProperty(PropertyName = "usedBytes")] - public long? UsedBytes { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "usedBytes")] + public long? UsedBytes {get; set; } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AzureNetAppFilesManagementClient.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppManagementClient.cs similarity index 57% rename from src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AzureNetAppFilesManagementClient.cs rename to src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppManagementClient.cs index 3d589ddca469..647faa662917 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AzureNetAppFilesManagementClient.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppManagementClient.cs @@ -1,50 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; /// /// Microsoft NetApp Files Azure Resource Provider specification /// - public partial class AzureNetAppFilesManagementClient : ServiceClient, IAzureNetAppFilesManagementClient, IAzureClient + public partial class NetAppManagementClient : Microsoft.Rest.ServiceClient, INetAppManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// The API version to use for this operation. @@ -54,122 +40,106 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient /// The ID of the target subscription. /// - public string SubscriptionId { get; set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the INetAppResourceOperations. + /// Gets the INetAppResourceOperations /// public virtual INetAppResourceOperations NetAppResource { get; private set; } - /// - /// Gets the INetAppResourceQuotaLimitsOperations. + /// Gets the INetAppResourceQuotaLimitsOperations /// public virtual INetAppResourceQuotaLimitsOperations NetAppResourceQuotaLimits { get; private set; } - /// - /// Gets the IAccountsOperations. + /// Gets the IAccountsOperations /// public virtual IAccountsOperations Accounts { get; private set; } - /// - /// Gets the IPoolsOperations. + /// Gets the IPoolsOperations /// public virtual IPoolsOperations Pools { get; private set; } - /// - /// Gets the IVolumesOperations. + /// Gets the IVolumesOperations /// public virtual IVolumesOperations Volumes { get; private set; } - /// - /// Gets the ISnapshotsOperations. + /// Gets the ISnapshotsOperations /// public virtual ISnapshotsOperations Snapshots { get; private set; } - /// - /// Gets the ISnapshotPoliciesOperations. + /// Gets the ISnapshotPoliciesOperations /// public virtual ISnapshotPoliciesOperations SnapshotPolicies { get; private set; } - /// - /// Gets the IBackupsOperations. + /// Gets the IBackupsOperations /// public virtual IBackupsOperations Backups { get; private set; } - /// - /// Gets the IAccountBackupsOperations. + /// Gets the IAccountBackupsOperations /// public virtual IAccountBackupsOperations AccountBackups { get; private set; } - /// - /// Gets the IBackupPoliciesOperations. + /// Gets the IBackupPoliciesOperations /// public virtual IBackupPoliciesOperations BackupPolicies { get; private set; } - /// - /// Gets the IVolumeQuotaRulesOperations. + /// Gets the IVolumeQuotaRulesOperations /// public virtual IVolumeQuotaRulesOperations VolumeQuotaRules { get; private set; } - /// - /// Gets the IVolumeGroupsOperations. + /// Gets the IVolumeGroupsOperations /// public virtual IVolumeGroupsOperations VolumeGroups { get; private set; } - /// - /// Gets the ISubvolumesOperations. + /// Gets the ISubvolumesOperations /// public virtual ISubvolumesOperations Subvolumes { get; private set; } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// HttpClient to be used /// /// - /// True: will dispose the provided httpClient on calling AzureNetAppFilesManagementClient.Dispose(). False: will not dispose provided httpClient - protected AzureNetAppFilesManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + /// True: will dispose the provided httpClient on calling NetAppManagementClient.Dispose(). False: will not dispose provided httpClient + protected NetAppManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AzureNetAppFilesManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected NetAppManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -177,13 +147,12 @@ protected AzureNetAppFilesManagementClient(params DelegatingHandler[] handlers) /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AzureNetAppFilesManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected NetAppManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Optional. The base URI of the service. @@ -194,17 +163,16 @@ protected AzureNetAppFilesManagementClient(HttpClientHandler rootHandler, params /// /// Thrown when a required parameter is null /// - protected AzureNetAppFilesManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected NetAppManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Optional. The base URI of the service. @@ -218,17 +186,17 @@ protected AzureNetAppFilesManagementClient(System.Uri baseUri, params Delegating /// /// Thrown when a required parameter is null /// - protected AzureNetAppFilesManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected NetAppManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Required. Credentials needed for the client to connect to Azure. @@ -239,50 +207,50 @@ protected AzureNetAppFilesManagementClient(System.Uri baseUri, HttpClientHandler /// /// Thrown when a required parameter is null /// - public AzureNetAppFilesManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public NetAppManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// HttpClient to be used /// /// - /// True: will dispose the provided httpClient on calling AzureNetAppFilesManagementClient.Dispose(). False: will not dispose provided httpClient + /// True: will dispose the provided httpClient on calling NetAppManagementClient.Dispose(). False: will not dispose provided httpClient /// /// Thrown when a required parameter is null /// - public AzureNetAppFilesManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public NetAppManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -294,26 +262,26 @@ public AzureNetAppFilesManagementClient(ServiceClientCredentials credentials, Ht /// /// Thrown when a required parameter is null /// - public AzureNetAppFilesManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public NetAppManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -322,7 +290,7 @@ public AzureNetAppFilesManagementClient(ServiceClientCredentials credentials, Ht /// /// Thrown when a required parameter is null /// - public AzureNetAppFilesManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public NetAppManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -332,33 +300,30 @@ public AzureNetAppFilesManagementClient(System.Uri baseUri, ServiceClientCredent { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// - /// Initializes a new instance of the AzureNetAppFilesManagementClient class. + /// Initializes a new instance of the NetAppManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public AzureNetAppFilesManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public NetAppManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -368,71 +333,72 @@ public AzureNetAppFilesManagementClient(System.Uri baseUri, ServiceClientCredent { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Operations = new Operations(this); - NetAppResource = new NetAppResourceOperations(this); - NetAppResourceQuotaLimits = new NetAppResourceQuotaLimitsOperations(this); - Accounts = new AccountsOperations(this); - Pools = new PoolsOperations(this); - Volumes = new VolumesOperations(this); - Snapshots = new SnapshotsOperations(this); - SnapshotPolicies = new SnapshotPoliciesOperations(this); - Backups = new BackupsOperations(this); - AccountBackups = new AccountBackupsOperations(this); - BackupPolicies = new BackupPoliciesOperations(this); - VolumeQuotaRules = new VolumeQuotaRulesOperations(this); - VolumeGroups = new VolumeGroupsOperations(this); - Subvolumes = new SubvolumesOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2022-11-01"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Operations = new Operations(this); + this.NetAppResource = new NetAppResourceOperations(this); + this.NetAppResourceQuotaLimits = new NetAppResourceQuotaLimitsOperations(this); + this.Accounts = new AccountsOperations(this); + this.Pools = new PoolsOperations(this); + this.Volumes = new VolumesOperations(this); + this.Snapshots = new SnapshotsOperations(this); + this.SnapshotPolicies = new SnapshotPoliciesOperations(this); + this.Backups = new BackupsOperations(this); + this.AccountBackups = new AccountBackupsOperations(this); + this.BackupPolicies = new BackupPoliciesOperations(this); + this.VolumeQuotaRules = new VolumeQuotaRulesOperations(this); + this.VolumeGroups = new VolumeGroupsOperations(this); + this.Subvolumes = new SubvolumesOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2022-11-01"; + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperations.cs index 62bfdec662e2..af77d3803755 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// NetAppResourceOperations operations. /// - internal partial class NetAppResourceOperations : IServiceOperations, INetAppResourceOperations + internal partial class NetAppResourceOperations : Microsoft.Rest.IServiceOperations, INetAppResourceOperations { /// /// Initializes a new instance of the NetAppResourceOperations class. @@ -36,26 +24,23 @@ internal partial class NetAppResourceOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) + internal NetAppResourceOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Check resource name availability - /// - /// /// Check if a resource name is available. - /// + /// /// /// The name of Azure region. /// @@ -63,11 +48,7 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// Resource name to verify. /// /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + /// Resource type used for verification. /// /// /// Resource group name. @@ -78,13 +59,13 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -93,106 +74,95 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (type == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "type"); - } - if (resourceGroup == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + ResourceNameAvailabilityRequest body = new ResourceNameAvailabilityRequest(); - if (name != null || type != null || resourceGroup != null) + if(name != null||type != null||resourceGroup != null) { body.Name = name; body.Type = type; body.ResourceGroup = resourceGroup; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -204,61 +174,62 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -268,9 +239,10 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -281,31 +253,32 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Check file path availability - /// - /// /// Check if a file path is available. - /// + /// /// /// The name of Azure region. /// @@ -313,8 +286,7 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// File path to verify. /// /// - /// The Azure Resource URI for a delegated subnet. Must have the delegation - /// Microsoft.NetApp/volumes + /// The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes /// /// /// Headers that will be added to request. @@ -322,13 +294,13 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -337,101 +309,94 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckFilePathAvailabilityWithHttpMessagesAsync(string location, string name, string subnetId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckFilePathAvailabilityWithHttpMessagesAsync(string location, string name, string subnetId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (name == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (subnetId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + FilePathAvailabilityRequest body = new FilePathAvailabilityRequest(); - if (name != null || subnetId != null) + if(name != null||subnetId != null) { body.Name = name; body.SubnetId = subnetId; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckFilePathAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckFilePathAvailability", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -443,61 +408,62 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -507,9 +473,10 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -520,31 +487,32 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Check quota availability - /// - /// /// Check if a quota is available. - /// + /// /// /// The name of Azure region. /// @@ -552,11 +520,7 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// Name of the resource to verify. /// /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + /// Resource type used for verification. /// /// /// Resource group name. @@ -567,13 +531,13 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -582,106 +546,95 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "type"); - } - if (resourceGroup == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + QuotaAvailabilityRequest body = new QuotaAvailabilityRequest(); - if (name != null || type != null || resourceGroup != null) + if(name != null||type != null||resourceGroup != null) { body.Name = name; body.Type = type; body.ResourceGroup = resourceGroup; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckQuotaAvailability", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckQuotaAvailability", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -693,61 +646,62 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -757,9 +711,10 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -770,31 +725,32 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describes region specific information. - /// - /// /// Provides storage to network proximity and logical zone mapping information. - /// + /// /// /// The name of Azure region. /// @@ -804,13 +760,13 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -819,86 +775,87 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> QueryRegionInfoWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> QueryRegionInfoWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "QueryRegionInfo", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "QueryRegionInfo", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -910,55 +867,56 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -968,9 +926,10 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -981,24 +940,28 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperationsExtensions.cs index 18e0d6148443..e73e7887d35e 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceOperationsExtensions.cs @@ -1,251 +1,148 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetAppResourceOperations. + /// Extension methods for NetAppResourceOperations /// public static partial class NetAppResourceOperationsExtensions { - /// - /// Check resource name availability - /// - /// - /// Check if a resource name is available. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Resource name to verify. - /// - /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' - /// - /// - /// Resource group name. - /// - public static CheckAvailabilityResponse CheckNameAvailability(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup) - { - return operations.CheckNameAvailabilityAsync(location, name, type, resourceGroup).GetAwaiter().GetResult(); - } + /// + /// Check if a resource name is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static CheckAvailabilityResponse CheckNameAvailability(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup) + { + return ((INetAppResourceOperations)operations).CheckNameAvailabilityAsync(location, name, type, resourceGroup).GetAwaiter().GetResult(); + } - /// - /// Check resource name availability - /// - /// - /// Check if a resource name is available. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Resource name to verify. - /// - /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' - /// - /// - /// Resource group name. - /// - /// - /// The cancellation token. - /// - public static async Task CheckNameAvailabilityAsync(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Check if a resource name is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckNameAvailabilityAsync(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(location, name, type, resourceGroup, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(location, name, type, resourceGroup, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Check if a file path is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static CheckAvailabilityResponse CheckFilePathAvailability(this INetAppResourceOperations operations, string location, string name, string subnetId) + { + return ((INetAppResourceOperations)operations).CheckFilePathAvailabilityAsync(location, name, subnetId).GetAwaiter().GetResult(); + } - /// - /// Check file path availability - /// - /// - /// Check if a file path is available. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// File path to verify. - /// - /// - /// The Azure Resource URI for a delegated subnet. Must have the delegation - /// Microsoft.NetApp/volumes - /// - public static CheckAvailabilityResponse CheckFilePathAvailability(this INetAppResourceOperations operations, string location, string name, string subnetId) + /// + /// Check if a file path is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckFilePathAvailabilityAsync(this INetAppResourceOperations operations, string location, string name, string subnetId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckFilePathAvailabilityWithHttpMessagesAsync(location, name, subnetId, null, cancellationToken).ConfigureAwait(false)) { - return operations.CheckFilePathAvailabilityAsync(location, name, subnetId).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Check if a quota is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static CheckAvailabilityResponse CheckQuotaAvailability(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup) + { + return ((INetAppResourceOperations)operations).CheckQuotaAvailabilityAsync(location, name, type, resourceGroup).GetAwaiter().GetResult(); + } - /// - /// Check file path availability - /// - /// - /// Check if a file path is available. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// File path to verify. - /// - /// - /// The Azure Resource URI for a delegated subnet. Must have the delegation - /// Microsoft.NetApp/volumes - /// - /// - /// The cancellation token. - /// - public static async Task CheckFilePathAvailabilityAsync(this INetAppResourceOperations operations, string location, string name, string subnetId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Check if a quota is available. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckQuotaAvailabilityAsync(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckQuotaAvailabilityWithHttpMessagesAsync(location, name, type, resourceGroup, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CheckFilePathAvailabilityWithHttpMessagesAsync(location, name, subnetId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Provides storage to network proximity and logical zone mapping information. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static RegionInfo QueryRegionInfo(this INetAppResourceOperations operations, string location) + { + return ((INetAppResourceOperations)operations).QueryRegionInfoAsync(location).GetAwaiter().GetResult(); + } - /// - /// Check quota availability - /// - /// - /// Check if a quota is available. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Name of the resource to verify. - /// - /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' - /// - /// - /// Resource group name. - /// - public static CheckAvailabilityResponse CheckQuotaAvailability(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup) + /// + /// Provides storage to network proximity and logical zone mapping information. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task QueryRegionInfoAsync(this INetAppResourceOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.QueryRegionInfoWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - return operations.CheckQuotaAvailabilityAsync(location, name, type, resourceGroup).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Check quota availability - /// - /// - /// Check if a quota is available. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// Name of the resource to verify. - /// - /// - /// Resource type used for verification. Possible values include: - /// 'Microsoft.NetApp/netAppAccounts', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', - /// 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' - /// - /// - /// Resource group name. - /// - /// - /// The cancellation token. - /// - public static async Task CheckQuotaAvailabilityAsync(this INetAppResourceOperations operations, string location, string name, string type, string resourceGroup, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckQuotaAvailabilityWithHttpMessagesAsync(location, name, type, resourceGroup, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describes region specific information. - /// - /// - /// Provides storage to network proximity and logical zone mapping information. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static RegionInfo QueryRegionInfo(this INetAppResourceOperations operations, string location) - { - return operations.QueryRegionInfoAsync(location).GetAwaiter().GetResult(); - } - - /// - /// Describes region specific information. - /// - /// - /// Provides storage to network proximity and logical zone mapping information. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task QueryRegionInfoAsync(this INetAppResourceOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.QueryRegionInfoWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperations.cs index a87bd208f37f..d6d162fb032b 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// NetAppResourceQuotaLimitsOperations operations. /// - internal partial class NetAppResourceQuotaLimitsOperations : IServiceOperations, INetAppResourceQuotaLimitsOperations + internal partial class NetAppResourceQuotaLimitsOperations : Microsoft.Rest.IServiceOperations, INetAppResourceQuotaLimitsOperations { /// /// Initializes a new instance of the NetAppResourceQuotaLimitsOperations class. @@ -36,26 +24,23 @@ internal partial class NetAppResourceQuotaLimitsOperations : IServiceOperations< /// /// Thrown when a required parameter is null /// - internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient client) + internal NetAppResourceQuotaLimitsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Get quota limits - /// - /// /// Get the default and current limits for quotas - /// + /// /// /// The name of Azure region. /// @@ -65,13 +50,13 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,86 +65,87 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -171,55 +157,56 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -229,9 +216,10 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -242,31 +230,32 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get quota limits - /// - /// /// Get the default and current subscription quota limit - /// + /// /// /// The name of Azure region. /// @@ -279,13 +268,13 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -294,92 +283,94 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string quotaLimitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string quotaLimitName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } if (location != null) { if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "location", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "location", 1); } } if (quotaLimitName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "quotaLimitName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "quotaLimitName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("quotaLimitName", quotaLimitName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{quotaLimitName}", System.Uri.EscapeDataString(quotaLimitName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -391,55 +382,56 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -449,9 +441,10 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -462,24 +455,28 @@ internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs index 54825991d4dd..0febbd803231 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs @@ -1,113 +1,88 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for NetAppResourceQuotaLimitsOperations. + /// Extension methods for NetAppResourceQuotaLimitsOperations /// public static partial class NetAppResourceQuotaLimitsOperationsExtensions { - /// - /// Get quota limits - /// - /// - /// Get the default and current limits for quotas - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - public static IEnumerable List(this INetAppResourceQuotaLimitsOperations operations, string location) - { - return operations.ListAsync(location).GetAwaiter().GetResult(); - } + /// + /// Get the default and current limits for quotas + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + public static System.Collections.Generic.IEnumerable List(this INetAppResourceQuotaLimitsOperations operations, string location) + { + return ((INetAppResourceQuotaLimitsOperations)operations).ListAsync(location).GetAwaiter().GetResult(); + } - /// - /// Get quota limits - /// - /// - /// Get the default and current limits for quotas - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this INetAppResourceQuotaLimitsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the default and current limits for quotas + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this INetAppResourceQuotaLimitsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get the default and current subscription quota limit + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the Quota Limit + /// + public static SubscriptionQuotaItem Get(this INetAppResourceQuotaLimitsOperations operations, string location, string quotaLimitName) + { + return ((INetAppResourceQuotaLimitsOperations)operations).GetAsync(location, quotaLimitName).GetAwaiter().GetResult(); + } - /// - /// Get quota limits - /// - /// - /// Get the default and current subscription quota limit - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the Quota Limit - /// - public static SubscriptionQuotaItem Get(this INetAppResourceQuotaLimitsOperations operations, string location, string quotaLimitName) + /// + /// Get the default and current subscription quota limit + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of Azure region. + /// + /// + /// The name of the Quota Limit + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this INetAppResourceQuotaLimitsOperations operations, string location, string quotaLimitName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, quotaLimitName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(location, quotaLimitName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Get quota limits - /// - /// - /// Get the default and current subscription quota limit - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of Azure region. - /// - /// - /// The name of the Quota Limit - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetAppResourceQuotaLimitsOperations operations, string location, string quotaLimitName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(location, quotaLimitName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Operations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Operations.cs index 4e0854b6f51f..9a449d3af9bd 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Operations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/Operations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,39 +24,36 @@ internal partial class Operations : IServiceOperations /// Thrown when a required parameter is null /// - internal Operations(AzureNetAppFilesManagementClient client) + internal Operations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Describes the Resource Provider - /// - /// /// Lists all of the available Microsoft.NetApp Rest API operations - /// + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,61 +62,62 @@ internal Operations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + + + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.NetApp/operations").ToString(); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -143,55 +129,56 @@ internal Operations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -201,9 +188,10 @@ internal Operations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -214,24 +202,28 @@ internal Operations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/OperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/OperationsExtensions.cs index 093618017607..8185656b080a 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/OperationsExtensions.cs @@ -1,61 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for Operations /// public static partial class OperationsExtensions { - /// - /// Describes the Resource Provider - /// - /// - /// Lists all of the available Microsoft.NetApp Rest API operations - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Lists all of the available Microsoft.NetApp Rest API operations + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Describes the Resource Provider - /// - /// - /// Lists all of the available Microsoft.NetApp Rest API operations - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the available Microsoft.NetApp Rest API operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperations.cs index d5015aa69933..b435c9b3f39b 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// PoolsOperations operations. /// - internal partial class PoolsOperations : IServiceOperations, IPoolsOperations + internal partial class PoolsOperations : Microsoft.Rest.IServiceOperations, IPoolsOperations { /// /// Initializes a new instance of the PoolsOperations class. @@ -36,26 +24,23 @@ internal partial class PoolsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PoolsOperations(AzureNetAppFilesManagementClient client) + internal PoolsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Describe all Capacity Pools - /// - /// /// List all capacity pools in the NetApp Account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -68,13 +53,13 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,103 +68,104 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -191,55 +177,56 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,9 +236,10 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -262,31 +250,32 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a Capacity Pool - /// - /// /// Get details of the specified capacity pool - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -302,13 +291,13 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -317,124 +306,125 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -446,55 +436,56 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -504,9 +495,10 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -517,34 +509,32 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create or Update the specified capacity pool within the resource group - /// - /// /// Create or Update a capacity pool - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -554,28 +544,25 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(CapacityPool body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPool body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a capacity pool - /// - /// /// Patch the specified capacity pool - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -585,25 +572,25 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a capacity pool - /// - /// /// Delete the specified capacity pool - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -614,27 +601,21 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// The name of the capacity pool /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or Update the specified capacity pool within the resource group - /// - /// /// Create or Update a capacity pool - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -644,19 +625,22 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the 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 /// /// @@ -665,133 +649,134 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(CapacityPool body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPool body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -803,61 +788,62 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -867,9 +853,10 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -880,16 +867,16 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -898,34 +885,32 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Update a capacity pool - /// - /// /// Patch the specified capacity pool - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -935,19 +920,22 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the capacity pool /// + /// + /// Capacity pool object supplied in the body of the 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 /// /// @@ -956,129 +944,130 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1090,61 +1079,62 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1154,9 +1144,10 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1167,31 +1158,32 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a capacity pool - /// - /// /// Delete the specified capacity pool - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1207,10 +1199,10 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1219,124 +1211,125 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1348,55 +1341,56 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1406,26 +1400,28 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe all Capacity Pools - /// - /// /// List all capacity pools in the NetApp Account - /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -1435,13 +1431,13 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1450,51 +1446,54 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1506,55 +1505,56 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1564,9 +1564,10 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1577,24 +1578,28 @@ internal PoolsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperationsExtensions.cs index e59d83f20e6a..b5cb75a1c715 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/PoolsOperationsExtensions.cs @@ -1,493 +1,397 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for PoolsOperations. + /// Extension methods for PoolsOperations /// public static partial class PoolsOperationsExtensions { - /// - /// Describe all Capacity Pools - /// - /// - /// List all capacity pools in the NetApp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static IPage List(this IPoolsOperations operations, string resourceGroupName, string accountName) - { - return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Describe all Capacity Pools - /// - /// - /// List all capacity pools in the NetApp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe a Capacity Pool - /// - /// - /// Get details of the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static CapacityPool Get(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName) - { - return operations.GetAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); - } - - /// - /// Describe a Capacity Pool - /// - /// - /// Get details of the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or Update the specified capacity pool within the resource group - /// - /// - /// Create or Update a capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static CapacityPool CreateOrUpdate(this IPoolsOperations operations, CapacityPool body, string resourceGroupName, string accountName, string poolName) - { - return operations.CreateOrUpdateAsync(body, resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); - } - - /// - /// Create or Update the specified capacity pool within the resource group - /// - /// - /// Create or Update a capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPoolsOperations operations, CapacityPool body, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a capacity pool - /// - /// - /// Patch the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static CapacityPool Update(this IPoolsOperations operations, CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName) - { - return operations.UpdateAsync(body, resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); - } - - /// - /// Update a capacity pool - /// - /// - /// Patch the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IPoolsOperations operations, CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List all capacity pools in the NetApp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static Microsoft.Rest.Azure.IPage List(this IPoolsOperations operations, string resourceGroupName, string accountName) + { + return ((IPoolsOperations)operations).ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Delete a capacity pool - /// - /// - /// Delete the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static void Delete(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName) + /// + /// List all capacity pools in the NetApp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get details of the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static CapacityPool Get(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName) + { + return ((IPoolsOperations)operations).GetAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + } - /// - /// Delete a capacity pool - /// - /// - /// Delete the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get details of the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Create or Update a capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static CapacityPool CreateOrUpdate(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPool body) + { + return ((IPoolsOperations)operations).CreateOrUpdateAsync(resourceGroupName, accountName, poolName, body).GetAwaiter().GetResult(); + } - /// - /// Create or Update the specified capacity pool within the resource group - /// - /// - /// Create or Update a capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static CapacityPool BeginCreateOrUpdate(this IPoolsOperations operations, CapacityPool body, string resourceGroupName, string accountName, string poolName) + /// + /// Create or Update a capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPool body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(body, resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static CapacityPool Update(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body) + { + return ((IPoolsOperations)operations).UpdateAsync(resourceGroupName, accountName, poolName, body).GetAwaiter().GetResult(); + } - /// - /// Create or Update the specified capacity pool within the resource group - /// - /// - /// Create or Update a capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IPoolsOperations operations, CapacityPool body, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static void Delete(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName) + { + ((IPoolsOperations)operations).DeleteAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + } - /// - /// Update a capacity pool - /// - /// - /// Patch the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static CapacityPool BeginUpdate(this IPoolsOperations operations, CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName) - { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); - } - - /// - /// Update a capacity pool - /// - /// - /// Patch the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Capacity pool object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IPoolsOperations operations, CapacityPoolPatch body, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or Update a capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static CapacityPool BeginCreateOrUpdate(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPool body) + { + return ((IPoolsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a capacity pool - /// - /// - /// Delete the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static void BeginDelete(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName) + /// + /// Create or Update a capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPool body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static CapacityPool BeginUpdate(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body) + { + return ((IPoolsOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, poolName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a capacity pool - /// - /// - /// Delete the specified capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, CapacityPoolPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static void BeginDelete(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName) + { + ((IPoolsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + } - /// - /// Describe all Capacity Pools - /// - /// - /// List all capacity pools in the NetApp Account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPoolsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } + /// + /// Delete the specified capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPoolsOperations operations, string resourceGroupName, string accountName, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List all capacity pools in the NetApp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPoolsOperations operations, string nextPageLink) + { + return ((IPoolsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Describe all Capacity Pools - /// - /// - /// List all capacity pools in the NetApp Account - /// - /// - /// 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 IPoolsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all capacity pools in the NetApp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPoolsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SdkInfo_NetAppManagementClient.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SdkInfo_NetAppManagementClient.cs deleted file mode 100644 index e73e9d3348db..000000000000 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SdkInfo_NetAppManagementClient.cs +++ /dev/null @@ -1,40 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_NetAppManagementClient - { - get - { - return new Tuple[] - { - new Tuple("NetApp", "AccountBackups", "2022-11-01"), - new Tuple("NetApp", "Accounts", "2022-11-01"), - new Tuple("NetApp", "BackupPolicies", "2022-11-01"), - new Tuple("NetApp", "Backups", "2022-11-01"), - new Tuple("NetApp", "NetAppResource", "2022-11-01"), - new Tuple("NetApp", "NetAppResourceQuotaLimits", "2022-11-01"), - new Tuple("NetApp", "Operations", "2022-11-01"), - new Tuple("NetApp", "Pools", "2022-11-01"), - new Tuple("NetApp", "SnapshotPolicies", "2022-11-01"), - new Tuple("NetApp", "Snapshots", "2022-11-01"), - new Tuple("NetApp", "Subvolumes", "2022-11-01"), - new Tuple("NetApp", "VolumeGroups", "2022-11-01"), - new Tuple("NetApp", "VolumeQuotaRules", "2022-11-01"), - new Tuple("NetApp", "Volumes", "2022-11-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperations.cs index 2ff22fe8dc39..c98e6372e733 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// SnapshotPoliciesOperations operations. /// - internal partial class SnapshotPoliciesOperations : IServiceOperations, ISnapshotPoliciesOperations + internal partial class SnapshotPoliciesOperations : Microsoft.Rest.IServiceOperations, ISnapshotPoliciesOperations { /// /// Initializes a new instance of the SnapshotPoliciesOperations class. @@ -36,19 +24,19 @@ internal partial class SnapshotPoliciesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) + internal SnapshotPoliciesOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// /// List snapshot policy @@ -65,13 +53,13 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,103 +68,104 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -188,55 +177,56 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -246,9 +236,10 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -259,25 +250,29 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get a snapshot Policy /// @@ -296,13 +291,13 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -311,109 +306,111 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("snapshotPolicyName", snapshotPolicyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{snapshotPolicyName}", System.Uri.EscapeDataString(snapshotPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -425,55 +422,56 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -483,9 +481,10 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -496,31 +495,32 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create a snapshot policy /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -530,19 +530,22 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot policy /// + /// + /// Snapshot policy object supplied in the body of the 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 /// /// @@ -551,118 +554,120 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(SnapshotPolicy body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicy body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotPolicyName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotPolicyName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("snapshotPolicyName", snapshotPolicyName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{snapshotPolicyName}", System.Uri.EscapeDataString(snapshotPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -674,61 +679,62 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -738,9 +744,10 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -751,16 +758,16 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -769,31 +776,32 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Patch a snapshot policy /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -803,17 +811,20 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot policy /// + /// + /// Snapshot policy object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, snapshotPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -829,24 +840,21 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// The name of the snapshot policy /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get volumes for snapshot policy - /// - /// /// Get volumes associated with snapshot policy - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -862,13 +870,13 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -877,109 +885,111 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListVolumesWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListVolumesWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotPolicyName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotPolicyName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("snapshotPolicyName", snapshotPolicyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVolumes", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListVolumes", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{snapshotPolicyName}", System.Uri.EscapeDataString(snapshotPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -991,55 +1001,56 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1049,9 +1060,10 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1062,31 +1074,32 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Patch a snapshot policy /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1096,19 +1109,22 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot policy /// + /// + /// Snapshot policy object supplied in the body of the 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 /// /// @@ -1117,114 +1133,116 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotPolicyName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("snapshotPolicyName", snapshotPolicyName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{snapshotPolicyName}", System.Uri.EscapeDataString(snapshotPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1236,61 +1254,62 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1300,9 +1319,10 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1313,16 +1333,16 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1331,25 +1351,29 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete snapshot policy /// @@ -1368,10 +1392,10 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1380,109 +1404,111 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotPolicyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotPolicyName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("snapshotPolicyName", snapshotPolicyName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{snapshotPolicyName}", System.Uri.EscapeDataString(snapshotPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1494,55 +1520,56 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1552,19 +1579,24 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperationsExtensions.cs index 7f04e52d7542..db556a5ee2c1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotPoliciesOperationsExtensions.cs @@ -1,407 +1,364 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SnapshotPoliciesOperations. + /// Extension methods for SnapshotPoliciesOperations /// public static partial class SnapshotPoliciesOperationsExtensions { - /// - /// List snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static IEnumerable List(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName) - { - return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// List snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a snapshot Policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static SnapshotPolicy Get(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) - { - return operations.GetAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Get a snapshot Policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create a snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static SnapshotPolicy Create(this ISnapshotPoliciesOperations operations, SnapshotPolicy body, string resourceGroupName, string accountName, string snapshotPolicyName) - { - return operations.CreateAsync(body, resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); - } + /// + /// List snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static System.Collections.Generic.IEnumerable List(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName) + { + return ((ISnapshotPoliciesOperations)operations).ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Create a snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ISnapshotPoliciesOperations operations, SnapshotPolicy body, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get a snapshot Policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static SnapshotPolicy Get(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) + { + return ((ISnapshotPoliciesOperations)operations).GetAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + } - /// - /// Patch a snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static SnapshotPolicy Update(this ISnapshotPoliciesOperations operations, SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName) + /// + /// Get a snapshot Policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(body, resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create a snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static SnapshotPolicy Create(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicy body) + { + return ((ISnapshotPoliciesOperations)operations).CreateAsync(resourceGroupName, accountName, snapshotPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Patch a snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ISnapshotPoliciesOperations operations, SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicy body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Patch a snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static SnapshotPolicy Update(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body) + { + return ((ISnapshotPoliciesOperations)operations).UpdateAsync(resourceGroupName, accountName, snapshotPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Delete snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static void Delete(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) + /// + /// Patch a snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static void Delete(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) + { + ((ISnapshotPoliciesOperations)operations).DeleteAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + } - /// - /// Delete snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get volumes for snapshot policy - /// - /// - /// Get volumes associated with snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static SnapshotPolicyVolumeList ListVolumes(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) - { - return operations.ListVolumesAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Get volumes for snapshot policy - /// - /// - /// Get volumes associated with snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task ListVolumesAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListVolumesWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Patch a snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static SnapshotPolicy BeginUpdate(this ISnapshotPoliciesOperations operations, SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName) - { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); - } - - /// - /// Patch a snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot policy object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ISnapshotPoliciesOperations operations, SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get volumes associated with snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static SnapshotPolicyVolumeList ListVolumes(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) + { + return ((ISnapshotPoliciesOperations)operations).ListVolumesAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + } - /// - /// Delete snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - public static void BeginDelete(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) + /// + /// Get volumes associated with snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListVolumesAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListVolumesWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch a snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static SnapshotPolicy BeginUpdate(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body) + { + return ((ISnapshotPoliciesOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, snapshotPolicyName, body).GetAwaiter().GetResult(); + } - /// - /// Delete snapshot policy - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the snapshot policy - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch a snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, SnapshotPolicyPatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + public static void BeginDelete(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName) + { + ((ISnapshotPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, snapshotPolicyName).GetAwaiter().GetResult(); + } + /// + /// Delete snapshot policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the snapshot policy + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISnapshotPoliciesOperations operations, string resourceGroupName, string accountName, string snapshotPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, snapshotPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperations.cs index 900c28e7fd2d..c332693cc3b1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// SnapshotsOperations operations. /// - internal partial class SnapshotsOperations : IServiceOperations, ISnapshotsOperations + internal partial class SnapshotsOperations : Microsoft.Rest.IServiceOperations, ISnapshotsOperations { /// /// Initializes a new instance of the SnapshotsOperations class. @@ -36,26 +24,23 @@ internal partial class SnapshotsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SnapshotsOperations(AzureNetAppFilesManagementClient client) + internal SnapshotsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Describe all snapshots - /// - /// /// List all snapshots associated with the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,13 +59,13 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -89,145 +74,146 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -239,55 +225,56 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -297,9 +284,10 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -310,31 +298,32 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a snapshot - /// - /// /// Get details of the specified snapshot - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -356,13 +345,13 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -371,151 +360,153 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -527,55 +518,56 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -585,9 +577,10 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -598,34 +591,32 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create a snapshot - /// - /// /// Create the specified snapshot within the given volume - /// - /// - /// Snapshot object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -641,28 +632,25 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a snapshot - /// - /// /// Patch a snapshot - /// - /// - /// Snapshot object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -678,25 +666,25 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a snapshot - /// - /// /// Delete snapshot - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -713,28 +701,21 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// The name of the snapshot /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create a new Snapshot Restore Files request + /// Restore the specified files from the specified snapshot to the active filesystem /// - /// - /// Restore the specified files from the specified snapshot to the active - /// filesystem - /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -750,28 +731,25 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot /// + /// + /// Restore payload supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRestoreFilesWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create a snapshot - /// - /// /// Create the specified snapshot within the given volume - /// - /// - /// Snapshot object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -787,19 +765,22 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the 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 /// /// @@ -808,160 +789,162 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -973,61 +956,62 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1037,9 +1021,10 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1050,34 +1035,32 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Update a snapshot - /// - /// /// Patch a snapshot - /// - /// - /// Snapshot object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1093,19 +1076,22 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot /// + /// + /// Snapshot object supplied in the body of the 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 /// /// @@ -1114,156 +1100,158 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1275,61 +1263,62 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1339,9 +1328,10 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1352,31 +1342,32 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a snapshot - /// - /// /// Delete snapshot - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1398,10 +1389,10 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1410,151 +1401,153 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1566,55 +1559,56 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1624,30 +1618,28 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create a new Snapshot Restore Files request + /// Restore the specified files from the specified snapshot to the active filesystem /// - /// - /// Restore the specified files from the specified snapshot to the active - /// filesystem - /// - /// - /// Restore payload supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1663,16 +1655,19 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the snapshot /// + /// + /// Restore payload supplied in the body of the operation. + /// /// /// 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 /// /// @@ -1681,160 +1676,162 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRestoreFilesWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (snapshotName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "snapshotName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("snapshotName", snapshotName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFiles", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFiles", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1846,61 +1843,62 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1910,19 +1908,24 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs index 7936659eab32..1fc9b2b1f4d9 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SnapshotsOperationsExtensions.cs @@ -1,689 +1,568 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SnapshotsOperations. + /// Extension methods for SnapshotsOperations /// public static partial class SnapshotsOperationsExtensions { - /// - /// Describe all snapshots - /// - /// - /// List all snapshots associated with the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static IEnumerable List(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.ListAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Describe all snapshots - /// - /// - /// List all snapshots associated with the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe a snapshot - /// - /// - /// Get details of the specified snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static Snapshot Get(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) - { - return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Describe a snapshot - /// - /// - /// Get details of the specified snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create a snapshot - /// - /// - /// Create the specified snapshot within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static Snapshot Create(this ISnapshotsOperations operations, Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) - { - return operations.CreateAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); - } + /// + /// List all snapshots associated with the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static System.Collections.Generic.IEnumerable List(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((ISnapshotsOperations)operations).ListAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } - /// - /// Create a snapshot - /// - /// - /// Create the specified snapshot within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ISnapshotsOperations operations, Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all snapshots associated with the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get details of the specified snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static Snapshot Get(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + { + return ((ISnapshotsOperations)operations).GetAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + } - /// - /// Update a snapshot - /// - /// - /// Patch a snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static Snapshot Update(this ISnapshotsOperations operations, object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + /// + /// Get details of the specified snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create the specified snapshot within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static Snapshot Create(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body) + { + return ((ISnapshotsOperations)operations).CreateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).GetAwaiter().GetResult(); + } - /// - /// Update a snapshot - /// - /// - /// Patch a snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ISnapshotsOperations operations, object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create the specified snapshot within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Patch a snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static Snapshot Update(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body) + { + return ((ISnapshotsOperations)operations).UpdateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a snapshot - /// - /// - /// Delete snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static void Delete(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + /// + /// Patch a snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static void Delete(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + { + ((ISnapshotsOperations)operations).DeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + } - /// - /// Delete a snapshot - /// - /// - /// Delete snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restore the specified files from the specified snapshot to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static void RestoreFiles(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body) + { + ((ISnapshotsOperations)operations).RestoreFilesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).GetAwaiter().GetResult(); + } - /// - /// Create a new Snapshot Restore Files request - /// - /// - /// Restore the specified files from the specified snapshot to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static void RestoreFiles(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) - { - operations.RestoreFilesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); - } + /// + /// Restore the specified files from the specified snapshot to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RestoreFilesAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RestoreFilesWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create the specified snapshot within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static Snapshot BeginCreate(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body) + { + return ((ISnapshotsOperations)operations).BeginCreateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).GetAwaiter().GetResult(); + } - /// - /// Create a new Snapshot Restore Files request - /// - /// - /// Restore the specified files from the specified snapshot to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task RestoreFilesAsync(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create the specified snapshot within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Snapshot body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.RestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Patch a snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static Snapshot BeginUpdate(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body) + { + return ((ISnapshotsOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).GetAwaiter().GetResult(); + } - /// - /// Create a snapshot - /// - /// - /// Create the specified snapshot within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static Snapshot BeginCreate(this ISnapshotsOperations operations, Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + /// + /// Patch a snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, object body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static void BeginDelete(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + { + ((ISnapshotsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + } - /// - /// Create a snapshot - /// - /// - /// Create the specified snapshot within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this ISnapshotsOperations operations, Snapshot body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a snapshot - /// - /// - /// Patch a snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static Snapshot BeginUpdate(this ISnapshotsOperations operations, object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) - { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Update a snapshot - /// - /// - /// Patch a snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// Snapshot object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ISnapshotsOperations operations, object body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a snapshot - /// - /// - /// Delete snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static void BeginDelete(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) - { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Delete a snapshot - /// - /// - /// Delete snapshot - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a new Snapshot Restore Files request - /// - /// - /// Restore the specified files from the specified snapshot to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - public static void BeginRestoreFiles(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) - { - operations.BeginRestoreFilesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); - } - - /// - /// Create a new Snapshot Restore Files request - /// - /// - /// Restore the specified files from the specified snapshot to the active - /// filesystem - /// - /// - /// The operations group for this extension method. - /// - /// - /// Restore payload supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the snapshot - /// - /// - /// The cancellation token. - /// - public static async Task BeginRestoreFilesAsync(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete snapshot + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Restore the specified files from the specified snapshot to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + public static void BeginRestoreFiles(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body) + { + ((ISnapshotsOperations)operations).BeginRestoreFilesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).GetAwaiter().GetResult(); + } + /// + /// Restore the specified files from the specified snapshot to the active filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the snapshot + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRestoreFilesAsync(this ISnapshotsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, SnapshotRestoreFiles body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRestoreFilesWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperations.cs index afbb1e739b63..77ded5948bc5 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// SubvolumesOperations operations. /// - internal partial class SubvolumesOperations : IServiceOperations, ISubvolumesOperations + internal partial class SubvolumesOperations : Microsoft.Rest.IServiceOperations, ISubvolumesOperations { /// /// Initializes a new instance of the SubvolumesOperations class. @@ -36,26 +24,23 @@ internal partial class SubvolumesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SubvolumesOperations(AzureNetAppFilesManagementClient client) + internal SubvolumesOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// List of all the subvolumes - /// - /// /// Returns a list of the subvolumes in the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,13 +59,13 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -89,145 +74,146 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVolume", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVolume", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -239,55 +225,56 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -297,9 +284,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -310,31 +298,32 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get the path associated with the subvolumeName - /// - /// /// Returns the path associated with the subvolumeName provided - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -356,13 +345,13 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -371,166 +360,167 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (subvolumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subvolumeName"); } if (subvolumeName != null) { if (subvolumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "subvolumeName", 64); } if (subvolumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "subvolumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("subvolumeName", subvolumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -542,55 +532,56 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -600,9 +591,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -613,35 +605,32 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create or clone a new subvolume + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath /// - /// - /// Creates a subvolume in the path or clones the subvolume mentioned in the - /// parentPath - /// - /// - /// Subvolume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -657,28 +646,25 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a subvolume - /// - /// /// Patch a subvolume - /// - /// - /// Subvolume object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -694,25 +680,25 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a subvolume - /// - /// /// Delete subvolume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -729,24 +715,21 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the subvolume. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Describe a subvolume - /// - /// /// Get details of the specified subvolume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -763,28 +746,21 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the subvolume. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> GetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginGetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginGetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or clone a new subvolume + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath /// - /// - /// Creates a subvolume in the path or clones the subvolume mentioned in the - /// parentPath - /// - /// - /// Subvolume object supplied in the body of the operation. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -800,19 +776,22 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the 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 /// /// @@ -821,171 +800,173 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (subvolumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subvolumeName"); } if (subvolumeName != null) { if (subvolumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "subvolumeName", 64); } if (subvolumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "subvolumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("subvolumeName", subvolumeName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -997,61 +978,62 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1061,9 +1043,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1074,16 +1057,16 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1092,34 +1075,32 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Update a subvolume - /// - /// /// Patch a subvolume - /// - /// - /// Subvolume object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1135,19 +1116,22 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the subvolume. /// + /// + /// Subvolume object supplied in the body of the 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 /// /// @@ -1156,171 +1140,172 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (subvolumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subvolumeName"); } if (subvolumeName != null) { if (subvolumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "subvolumeName", 64); } if (subvolumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "subvolumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("subvolumeName", subvolumeName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1332,61 +1317,62 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1396,9 +1382,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1409,31 +1396,32 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a subvolume - /// - /// /// Delete subvolume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1455,10 +1443,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1467,166 +1455,167 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (subvolumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subvolumeName"); } if (subvolumeName != null) { if (subvolumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "subvolumeName", 64); } if (subvolumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "subvolumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("subvolumeName", subvolumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1638,55 +1627,56 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1696,26 +1686,28 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a subvolume - /// - /// /// Get details of the specified subvolume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1737,13 +1729,13 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1752,166 +1744,167 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginGetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginGetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (subvolumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "subvolumeName"); } if (subvolumeName != null) { if (subvolumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "subvolumeName", 64); } if (subvolumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "subvolumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "subvolumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("subvolumeName", subvolumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGetMetadata", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginGetMetadata", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1923,55 +1916,56 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1981,9 +1975,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1994,31 +1989,32 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// List of all the subvolumes - /// - /// /// Returns a list of the subvolumes in the volume - /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -2028,13 +2024,13 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2043,51 +2039,54 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVolumeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVolumeNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVolumeNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVolumeNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2099,55 +2098,56 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2157,9 +2157,10 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -2170,24 +2171,28 @@ internal SubvolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperationsExtensions.cs index 4437f484abff..2513b3095a01 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/SubvolumesOperationsExtensions.cs @@ -1,721 +1,607 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SubvolumesOperations. + /// Extension methods for SubvolumesOperations /// public static partial class SubvolumesOperationsExtensions { - /// - /// List of all the subvolumes - /// - /// - /// Returns a list of the subvolumes in the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static IPage ListByVolume(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.ListByVolumeAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// List of all the subvolumes - /// - /// - /// Returns a list of the subvolumes in the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVolumeAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVolumeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the path associated with the subvolumeName - /// - /// - /// Returns the path associated with the subvolumeName provided - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeInfo Get(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) - { - return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); - } - - /// - /// Get the path associated with the subvolumeName - /// - /// - /// Returns the path associated with the subvolumeName provided - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or clone a new subvolume - /// - /// - /// Creates a subvolume in the path or clones the subvolume mentioned in the - /// parentPath - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeInfo Create(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) - { - return operations.CreateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); - } - - /// - /// Create or clone a new subvolume - /// - /// - /// Creates a subvolume in the path or clones the subvolume mentioned in the - /// parentPath - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a subvolume - /// - /// - /// Patch a subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeInfo Update(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) - { - return operations.UpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); - } - - /// - /// Update a subvolume - /// - /// - /// Patch a subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static Microsoft.Rest.Azure.IPage ListByVolume(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((ISubvolumesOperations)operations).ListByVolumeAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } - /// - /// Delete a subvolume - /// - /// - /// Delete subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static void Delete(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVolumeAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVolumeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Returns the path associated with the subvolumeName provided + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeInfo Get(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return ((ISubvolumesOperations)operations).GetAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } - /// - /// Delete a subvolume - /// - /// - /// Delete subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Returns the path associated with the subvolumeName provided + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeInfo Create(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body) + { + return ((ISubvolumesOperations)operations).CreateAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body).GetAwaiter().GetResult(); + } - /// - /// Describe a subvolume - /// - /// - /// Get details of the specified subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeModel GetMetadata(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetMetadataAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeInfo Update(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body) + { + return ((ISubvolumesOperations)operations).UpdateAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body).GetAwaiter().GetResult(); + } - /// - /// Describe a subvolume - /// - /// - /// Get details of the specified subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task GetMetadataAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static void Delete(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + ((ISubvolumesOperations)operations).DeleteAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } - /// - /// Create or clone a new subvolume - /// - /// - /// Creates a subvolume in the path or clones the subvolume mentioned in the - /// parentPath - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeInfo BeginCreate(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) - { - return operations.BeginCreateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); - } + /// + /// Delete subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get details of the specified subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeModel GetMetadata(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return ((ISubvolumesOperations)operations).GetMetadataAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } - /// - /// Create or clone a new subvolume - /// - /// - /// Creates a subvolume in the path or clones the subvolume mentioned in the - /// parentPath - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get details of the specified subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetMetadataAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeInfo BeginCreate(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body) + { + return ((ISubvolumesOperations)operations).BeginCreateAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body).GetAwaiter().GetResult(); + } - /// - /// Update a subvolume - /// - /// - /// Patch a subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeInfo BeginUpdate(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumeInfo body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeInfo BeginUpdate(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body) + { + return ((ISubvolumesOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body).GetAwaiter().GetResult(); + } - /// - /// Update a subvolume - /// - /// - /// Patch a subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Subvolume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, SubvolumePatchRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Delete subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static void BeginDelete(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + ((ISubvolumesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } - /// - /// Delete a subvolume - /// - /// - /// Delete subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static void BeginDelete(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) - { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); - } + /// + /// Delete subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get details of the specified subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + public static SubvolumeModel BeginGetMetadata(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return ((ISubvolumesOperations)operations).BeginGetMetadataAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } - /// - /// Delete a subvolume - /// - /// - /// Delete subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get details of the specified subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of the subvolume. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGetMetadataAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginGetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByVolumeNext(this ISubvolumesOperations operations, string nextPageLink) + { + return ((ISubvolumesOperations)operations).ListByVolumeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Describe a subvolume - /// - /// - /// Get details of the specified subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - public static SubvolumeModel BeginGetMetadata(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVolumeNextAsync(this ISubvolumesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVolumeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginGetMetadataAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Describe a subvolume - /// - /// - /// Get details of the specified subvolume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of the subvolume. - /// - /// - /// The cancellation token. - /// - public static async Task BeginGetMetadataAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List of all the subvolumes - /// - /// - /// Returns a list of the subvolumes in the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByVolumeNext(this ISubvolumesOperations operations, string nextPageLink) - { - return operations.ListByVolumeNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List of all the subvolumes - /// - /// - /// Returns a list of the subvolumes in the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVolumeNextAsync(this ISubvolumesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVolumeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperations.cs index 0c4c22c7aa60..92277f7a3e49 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// VolumeGroupsOperations operations. /// - internal partial class VolumeGroupsOperations : IServiceOperations, IVolumeGroupsOperations + internal partial class VolumeGroupsOperations : Microsoft.Rest.IServiceOperations, IVolumeGroupsOperations { /// /// Initializes a new instance of the VolumeGroupsOperations class. @@ -36,26 +24,23 @@ internal partial class VolumeGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) + internal VolumeGroupsOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Describe all volume groups - /// - /// /// List all volume groups for given account - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -68,13 +53,13 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -83,103 +68,104 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNetAppAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByNetAppAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNetAppAccount", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByNetAppAccount", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -191,55 +177,56 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -249,9 +236,10 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -262,31 +250,32 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a Volume Group - /// - /// /// Get details of the specified volume group - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -302,13 +291,13 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -317,124 +306,125 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeGroupName"); } if (volumeGroupName != null) { if (volumeGroupName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeGroupName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeGroupName", 64); } if (volumeGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeGroupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("volumeGroupName", volumeGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{volumeGroupName}", System.Uri.EscapeDataString(volumeGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -446,55 +436,56 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -504,9 +495,10 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -517,37 +509,32 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create the specified volume group and volumes. Creating volume group will - /// create all the volumes specified in request body implicitly. Once volumes - /// are created using volume group, those will be treated as regular volumes - /// thereafter. - /// - /// /// Create a volume group along with specified volumes - /// - /// - /// Volume Group object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -557,26 +544,25 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volumeGroup /// + /// + /// Volume Group object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, volumeGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a volume group + /// Delete the specified volume group only if there are no volumes under volume group. /// - /// - /// Delete the specified volume group only if there are no volumes under volume - /// group. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -587,30 +573,21 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// The name of the volumeGroup /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create the specified volume group and volumes. Creating volume group will - /// create all the volumes specified in request body implicitly. Once volumes - /// are created using volume group, those will be treated as regular volumes - /// thereafter. - /// - /// /// Create a volume group along with specified volumes - /// - /// - /// Volume Group object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -620,19 +597,22 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volumeGroup /// + /// + /// Volume Group object supplied in the body of the 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 /// /// @@ -641,129 +621,131 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeGroupName"); } if (volumeGroupName != null) { if (volumeGroupName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeGroupName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeGroupName", 64); } if (volumeGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeGroupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("volumeGroupName", volumeGroupName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{volumeGroupName}", System.Uri.EscapeDataString(volumeGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -775,61 +757,62 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -839,9 +822,10 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -852,32 +836,32 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a volume group + /// Delete the specified volume group only if there are no volumes under volume group. /// - /// - /// Delete the specified volume group only if there are no volumes under volume - /// group. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -893,10 +877,10 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -905,124 +889,125 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeGroupName"); } if (volumeGroupName != null) { if (volumeGroupName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeGroupName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeGroupName", 64); } if (volumeGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeGroupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("volumeGroupName", volumeGroupName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{volumeGroupName}", System.Uri.EscapeDataString(volumeGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1034,55 +1019,56 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1092,19 +1078,24 @@ internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperationsExtensions.cs index 4b2573d19b1d..c177465a0014 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeGroupsOperationsExtensions.cs @@ -1,355 +1,274 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VolumeGroupsOperations. + /// Extension methods for VolumeGroupsOperations /// public static partial class VolumeGroupsOperationsExtensions { - /// - /// Describe all volume groups - /// - /// - /// List all volume groups for given account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - public static IEnumerable ListByNetAppAccount(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName) - { - return operations.ListByNetAppAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Describe all volume groups - /// - /// - /// List all volume groups for given account - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The cancellation token. - /// - public static async Task> ListByNetAppAccountAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByNetAppAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe a Volume Group - /// - /// - /// Get details of the specified volume group - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - public static VolumeGroupDetails Get(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) - { - return operations.GetAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); - } - - /// - /// Describe a Volume Group - /// - /// - /// Get details of the specified volume group - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List all volume groups for given account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + public static System.Collections.Generic.IEnumerable ListByNetAppAccount(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName) + { + return ((IVolumeGroupsOperations)operations).ListByNetAppAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } - /// - /// Create the specified volume group and volumes. Creating volume group will - /// create all the volumes specified in request body implicitly. Once volumes - /// are created using volume group, those will be treated as regular volumes - /// thereafter. - /// - /// - /// Create a volume group along with specified volumes - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume Group object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - public static VolumeGroupDetails Create(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName) + /// + /// List all volume groups for given account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByNetAppAccountAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByNetAppAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateAsync(body, resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get details of the specified volume group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static VolumeGroupDetails Get(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + { + return ((IVolumeGroupsOperations)operations).GetAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } - /// - /// Create the specified volume group and volumes. Creating volume group will - /// create all the volumes specified in request body implicitly. Once volumes - /// are created using volume group, those will be treated as regular volumes - /// thereafter. - /// - /// - /// Create a volume group along with specified volumes - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume Group object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get details of the specified volume group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static VolumeGroupDetails Create(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body) + { + return ((IVolumeGroupsOperations)operations).CreateAsync(resourceGroupName, accountName, volumeGroupName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a volume group - /// - /// - /// Delete the specified volume group only if there are no volumes under volume - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - public static void Delete(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete the specified volume group only if there are no volumes under volume group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static void Delete(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + { + ((IVolumeGroupsOperations)operations).DeleteAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } - /// - /// Delete a volume group - /// - /// - /// Delete the specified volume group only if there are no volumes under volume - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create the specified volume group and volumes. Creating volume group will - /// create all the volumes specified in request body implicitly. Once volumes - /// are created using volume group, those will be treated as regular volumes - /// thereafter. - /// - /// - /// Create a volume group along with specified volumes - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume Group object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - public static VolumeGroupDetails BeginCreate(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName) - { - return operations.BeginCreateAsync(body, resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); - } - - /// - /// Create the specified volume group and volumes. Creating volume group will - /// create all the volumes specified in request body implicitly. Once volumes - /// are created using volume group, those will be treated as regular volumes - /// thereafter. - /// - /// - /// Create a volume group along with specified volumes - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume Group object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a volume group - /// - /// - /// Delete the specified volume group only if there are no volumes under volume - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - public static void BeginDelete(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) - { - operations.BeginDeleteAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); - } + /// + /// Delete the specified volume group only if there are no volumes under volume group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static VolumeGroupDetails BeginCreate(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body) + { + return ((IVolumeGroupsOperations)operations).BeginCreateAsync(resourceGroupName, accountName, volumeGroupName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a volume group - /// - /// - /// Delete the specified volume group only if there are no volumes under volume - /// group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the volumeGroup - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, VolumeGroupDetails body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete the specified volume group only if there are no volumes under volume group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static void BeginDelete(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + { + ((IVolumeGroupsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } + /// + /// Delete the specified volume group only if there are no volumes under volume group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperations.cs index 2bc258f82e8d..5f6148d28372 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// VolumeQuotaRulesOperations operations. /// - internal partial class VolumeQuotaRulesOperations : IServiceOperations, IVolumeQuotaRulesOperations + internal partial class VolumeQuotaRulesOperations : Microsoft.Rest.IServiceOperations, IVolumeQuotaRulesOperations { /// /// Initializes a new instance of the VolumeQuotaRulesOperations class. @@ -36,26 +24,23 @@ internal partial class VolumeQuotaRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) + internal VolumeQuotaRulesOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Get all quota rules for a volume - /// - /// /// List all quota rules associated with the volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,13 +59,13 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -89,145 +74,146 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVolume", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByVolume", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -239,55 +225,56 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -297,9 +284,10 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -310,31 +298,32 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a quota rule - /// - /// /// Get details of the specified quota rule - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -356,13 +345,13 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -371,151 +360,153 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeQuotaRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeQuotaRuleName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("volumeQuotaRuleName", volumeQuotaRuleName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -527,55 +518,56 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -585,9 +577,10 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -598,34 +591,32 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create a quota rule - /// - /// /// Create the specified quota rule within the given volume - /// - /// - /// Quota rule object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -641,28 +632,25 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a quota rule - /// - /// /// Patch a quota rule - /// - /// - /// Quota rule object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -678,25 +666,25 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a quota rule - /// - /// /// Delete quota rule - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -713,27 +701,21 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// The name of volume quota rule /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create a quota rule - /// - /// /// Create the specified quota rule within the given volume - /// - /// - /// Quota rule object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -749,19 +731,22 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the 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 /// /// @@ -770,160 +755,162 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeQuotaRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeQuotaRuleName"); } - if (Client.ApiVersion == null) + + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("volumeQuotaRuleName", volumeQuotaRuleName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -935,61 +922,62 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -999,9 +987,10 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1012,16 +1001,16 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1030,34 +1019,32 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Update a quota rule - /// - /// /// Patch a quota rule - /// - /// - /// Quota rule object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1073,19 +1060,22 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The name of volume quota rule /// + /// + /// Quota rule object supplied in the body of the 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 /// /// @@ -1094,156 +1084,158 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeQuotaRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeQuotaRuleName"); } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("volumeQuotaRuleName", volumeQuotaRuleName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1255,61 +1247,62 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1319,9 +1312,10 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1332,31 +1326,32 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a quota rule - /// - /// /// Delete quota rule - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1378,10 +1373,10 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1390,151 +1385,153 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeQuotaRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeQuotaRuleName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("volumeQuotaRuleName", volumeQuotaRuleName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1546,55 +1543,56 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1604,19 +1602,24 @@ internal VolumeQuotaRulesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperationsExtensions.cs index dbfca3d5b054..3e9e03b0df7b 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumeQuotaRulesOperationsExtensions.cs @@ -1,551 +1,460 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VolumeQuotaRulesOperations. + /// Extension methods for VolumeQuotaRulesOperations /// public static partial class VolumeQuotaRulesOperationsExtensions { - /// - /// Get all quota rules for a volume - /// - /// - /// List all quota rules associated with the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static IEnumerable ListByVolume(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.ListByVolumeAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Get all quota rules for a volume - /// - /// - /// List all quota rules associated with the volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task> ListByVolumeAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByVolumeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe a quota rule - /// - /// - /// Get details of the specified quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static VolumeQuotaRule Get(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) - { - return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); - } - - /// - /// Describe a quota rule - /// - /// - /// Get details of the specified quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create a quota rule - /// - /// - /// Create the specified quota rule within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static VolumeQuotaRule Create(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) - { - return operations.CreateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); - } + /// + /// List all quota rules associated with the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static System.Collections.Generic.IEnumerable ListByVolume(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IVolumeQuotaRulesOperations)operations).ListByVolumeAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } - /// - /// Create a quota rule - /// - /// - /// Create the specified quota rule within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all quota rules associated with the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByVolumeAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByVolumeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get details of the specified quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule Get(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + return ((IVolumeQuotaRulesOperations)operations).GetAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } - /// - /// Update a quota rule - /// - /// - /// Patch a quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static VolumeQuotaRule Update(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + /// + /// Get details of the specified quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule Create(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body) + { + return ((IVolumeQuotaRulesOperations)operations).CreateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).GetAwaiter().GetResult(); + } - /// - /// Update a quota rule - /// - /// - /// Patch a quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule Update(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body) + { + return ((IVolumeQuotaRulesOperations)operations).UpdateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a quota rule - /// - /// - /// Delete quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static void Delete(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static void Delete(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + ((IVolumeQuotaRulesOperations)operations).DeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } - /// - /// Delete a quota rule - /// - /// - /// Delete quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a quota rule - /// - /// - /// Create the specified quota rule within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static VolumeQuotaRule BeginCreate(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) - { - return operations.BeginCreateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); - } - - /// - /// Create a quota rule - /// - /// - /// Create the specified quota rule within the given volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a quota rule - /// - /// - /// Patch a quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static VolumeQuotaRule BeginUpdate(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) - { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); - } - - /// - /// Update a quota rule - /// - /// - /// Patch a quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// Quota rule object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Delete quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule BeginCreate(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body) + { + return ((IVolumeQuotaRulesOperations)operations).BeginCreateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a quota rule - /// - /// - /// Delete quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - public static void BeginDelete(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRule body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule BeginUpdate(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body) + { + return ((IVolumeQuotaRulesOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).GetAwaiter().GetResult(); + } - /// - /// Delete a quota rule - /// - /// - /// Delete quota rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The name of volume quota rule - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, VolumeQuotaRulePatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static void BeginDelete(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + ((IVolumeQuotaRulesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + /// + /// Delete quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperations.cs index 479530d05665..a3f98e78c1f1 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperations.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { + using System.Linq; 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; /// /// VolumesOperations operations. /// - internal partial class VolumesOperations : IServiceOperations, IVolumesOperations + internal partial class VolumesOperations : Microsoft.Rest.IServiceOperations, IVolumesOperations { /// /// Initializes a new instance of the VolumesOperations class. @@ -36,26 +24,23 @@ internal partial class VolumesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal VolumesOperations(AzureNetAppFilesManagementClient client) + internal VolumesOperations (NetAppManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// - /// Gets a reference to the AzureNetAppFilesManagementClient + /// Gets a reference to the NetAppManagementClient /// - public AzureNetAppFilesManagementClient Client { get; private set; } + public NetAppManagementClient Client { get; private set; } /// - /// Describe all volumes - /// - /// /// List all volumes within the capacity pool - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -71,13 +56,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -86,124 +71,125 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -215,55 +201,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -273,9 +260,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -286,31 +274,32 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe a volume - /// - /// /// Get the details of the specified volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -329,13 +318,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -344,145 +333,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -494,55 +484,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -552,9 +543,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -565,34 +557,32 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Create or Update a volume - /// - /// /// Create or update the specified volume within the capacity pool - /// - /// - /// Volume object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -605,28 +595,25 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Volume body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a volume - /// - /// /// Patch the specified volume - /// - /// - /// Volume object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -639,25 +626,25 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the operation. + /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a volume - /// - /// /// Delete the specified volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -671,28 +658,24 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume + /// An option to force delete the volume. Will cleanup resources connected to the particular volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Revert a volume to one of its snapshots - /// - /// /// Revert a volume to the snapshot specified in the body - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -709,24 +692,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// Object for snapshot to revert supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Reset cifs password - /// - /// /// Reset cifs password from volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -740,24 +720,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Break file locks - /// - /// /// Break all the file locks on a volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -771,28 +748,24 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// Optional body to provide the ability to clear file locks with selected - /// options + /// Optional body to provide the ability to clear file locks with selected options /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> BreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationHeaderResponse _response = await BeginBreakFileLocksWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginBreakFileLocksWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get Group Id List for LDAP User - /// - /// /// Returns the list of group Ids for a specific LDAP User - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -809,24 +782,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// Returns group Id list for a specific LDAP user /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> ListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Break volume replication - /// - /// /// Break the replication connection on the destination volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -843,25 +813,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// Optional body to force break the replication. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginBreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Re-establish volume replication + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots /// - /// - /// Re-establish a previously deleted replication between 2 volumes that have a - /// common ad-hoc or policy-based snapshots - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -878,24 +844,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// body for the id of the source volume. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Get volume replication status - /// - /// /// Get the status of the replication - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -914,13 +877,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -929,145 +892,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ReplicationStatusMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ReplicationStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ReplicationStatusMethod", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ReplicationStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1079,55 +1043,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1137,9 +1102,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1150,31 +1116,32 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// List replications for volume - /// - /// /// List all replications for a specified volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1193,13 +1160,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1208,145 +1175,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListReplicationsMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListReplicationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListReplicationsMethod", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListReplications", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/listReplications").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1358,55 +1326,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1416,9 +1385,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1429,33 +1399,32 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Resync volume replication + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. /// - /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1469,25 +1438,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete volume replication + /// Delete the replication connection on the destination volume, and send release to the source replication /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1501,24 +1466,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Authorize source volume replication - /// - /// /// Authorize the replication connection on the source volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1535,24 +1497,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// Authorize request object supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task AuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task AuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginAuthorizeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginAuthorizeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// ReInitialize volume replication - /// - /// /// Re-Initializes the replication connection on the destination volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1566,24 +1525,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task ReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginReInitializeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginReInitializeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Change pool for volume - /// - /// /// Moves volume to another pool - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1600,24 +1556,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// Move volume to the pool supplied in the body of the operation. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task PoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task PoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginPoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Relocate volume - /// - /// /// Relocates volume to a new stamp - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1634,24 +1587,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// Relocate volume request /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Finalize volume relocation - /// - /// /// Finalizes the relocation of the volume and cleans up the old volume. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1665,25 +1615,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task FinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task FinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginFinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginFinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Revert volume relocation + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. /// - /// - /// Reverts the volume relocation process, cleans up the new volume and starts - /// using the former-existing volume. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1697,27 +1643,21 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task RevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task RevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginRevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or Update a volume - /// - /// /// Create or update the specified volume within the capacity pool - /// - /// - /// Volume object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1730,19 +1670,22 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the 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 /// /// @@ -1751,154 +1694,155 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Volume body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } if (body != null) { body.Validate(); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1910,61 +1854,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1974,9 +1919,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1987,16 +1933,16 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -2005,34 +1951,32 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Update a volume - /// - /// /// Patch the specified volume - /// - /// - /// Volume object supplied in the body of the operation. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2045,19 +1989,22 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// Volume object supplied in the body of the 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 /// /// @@ -2066,150 +2013,151 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (body == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2221,61 +2169,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2285,9 +2234,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -2298,31 +2248,32 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete a volume - /// - /// /// Delete the specified volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2336,8 +2287,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume + /// An option to force delete the volume. Will cleanup resources connected to the particular volume /// /// /// Headers that will be added to request. @@ -2345,10 +2295,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2357,150 +2307,152 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("forceDelete", forceDelete); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (forceDelete != null) { - _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, this.Client.SerializationSettings).Trim('"')))); } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2512,55 +2464,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2570,26 +2523,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Revert a volume to one of its snapshots - /// - /// /// Revert a volume to the snapshot specified in the body - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2611,10 +2566,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2623,150 +2578,152 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRevert", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRevert", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -2778,61 +2735,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2842,26 +2800,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Reset cifs password - /// - /// /// Reset cifs password from volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2880,10 +2840,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -2892,145 +2852,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResetCifsPassword", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResetCifsPassword", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resetCifsPassword").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3042,55 +3003,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3100,26 +3062,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Break file locks - /// - /// /// Break all the file locks on a volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -3133,8 +3097,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// Optional body to provide the ability to clear file locks with selected - /// options + /// Optional body to provide the ability to clear file locks with selected options /// /// /// Headers that will be added to request. @@ -3142,10 +3105,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3154,150 +3117,151 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginBreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginBreakFileLocksWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + body.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body != null) - { - body.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginBreakFileLocks", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBreakFileLocks", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakFileLocks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3309,61 +3273,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3373,39 +3338,41 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.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)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get Group Id List for LDAP User - /// - /// /// Returns the list of group Ids for a specific LDAP User - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -3427,13 +3394,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3442,154 +3409,155 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) + if (this.Client.ApiVersion == null) { - body.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListGetGroupIdListForLdapUser", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginListGetGroupIdListForLdapUser", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/getGroupIdListForLdapUser").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3601,56 +3569,57 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3660,9 +3629,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -3673,44 +3643,45 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Break volume replication - /// - /// /// Break the replication connection on the destination volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -3732,10 +3703,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -3744,146 +3715,148 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginBreakReplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBreakReplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -3895,61 +3868,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -3959,27 +3933,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Re-establish volume replication + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots /// - /// - /// Re-establish a previously deleted replication between 2 volumes that have a - /// common ad-hoc or policy-based snapshots - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -4001,10 +3976,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4013,150 +3988,152 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReestablishReplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReestablishReplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4168,61 +4145,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4232,28 +4210,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Resync volume replication + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. /// - /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -4272,10 +4250,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4284,145 +4262,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResyncReplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginResyncReplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4434,55 +4413,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4492,27 +4472,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Delete volume replication + /// Delete the replication connection on the destination volume, and send release to the source replication /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -4531,10 +4512,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4543,145 +4524,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteReplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteReplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4693,55 +4675,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -4751,26 +4734,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Authorize source volume replication - /// - /// /// Authorize the replication connection on the source volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -4792,10 +4777,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -4804,150 +4789,152 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginAuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginAuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAuthorizeReplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginAuthorizeReplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -4959,61 +4946,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5023,26 +5011,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// ReInitialize volume replication - /// - /// /// Re-Initializes the replication connection on the destination volume - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -5061,10 +5051,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5073,145 +5063,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) + if (this.Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReInitializeReplication", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginReInitializeReplication", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5223,55 +5214,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5281,26 +5273,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Change pool for volume - /// - /// /// Moves volume to another pool - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -5322,10 +5316,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5334,154 +5328,155 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + if (body != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + body.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) + if (this.Client.ApiVersion == null) { - body.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPoolChange", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginPoolChange", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5493,61 +5488,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5557,26 +5553,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Relocate volume - /// - /// /// Relocates volume to a new stamp - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -5598,10 +5596,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5610,146 +5608,148 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRelocate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRelocate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/relocate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -5761,61 +5761,62 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -5825,26 +5826,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Finalize volume relocation - /// - /// /// Finalizes the relocation of the volume and cleans up the old volume. - /// + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -5863,10 +5866,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -5875,145 +5878,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginFinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginFinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginFinalizeRelocation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginFinalizeRelocation", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/finalizeRelocation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6025,55 +6029,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6083,27 +6088,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Revert volume relocation + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. /// - /// - /// Reverts the volume relocation process, cleans up the new volume and starts - /// using the former-existing volume. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -6122,10 +6128,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6134,145 +6140,146 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginRevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (poolName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "poolName"); } if (poolName != null) { if (poolName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "poolName", 64); } if (poolName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "poolName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); } } if (volumeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "volumeName"); } if (volumeName != null) { if (volumeName.Length > 64) { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "volumeName", 64); } if (volumeName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "volumeName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (this.Client.ApiVersion == null) { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRevertRelocation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRevertRelocation", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revertRelocation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6284,55 +6291,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6342,26 +6350,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Describe all volumes - /// - /// /// List all volumes within the capacity pool - /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -6371,13 +6381,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -6386,51 +6396,54 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -6442,55 +6455,56 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.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)); + var ex = new Microsoft.Rest.Azure.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); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.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); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -6500,9 +6514,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -6513,24 +6528,28 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperationsExtensions.cs index daa066b183fd..372778b1d26c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperationsExtensions.cs +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/VolumesOperationsExtensions.cs @@ -1,2347 +1,1915 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.NetApp { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for VolumesOperations. + /// Extension methods for VolumesOperations /// public static partial class VolumesOperationsExtensions { - /// - /// Describe all volumes - /// - /// - /// List all volumes within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - public static IPage List(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName) - { - return operations.ListAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); - } - - /// - /// Describe all volumes - /// - /// - /// List all volumes within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Describe a volume - /// - /// - /// Get the details of the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static Volume Get(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Describe a volume - /// - /// - /// Get the details of the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or Update a volume - /// - /// - /// Create or update the specified volume within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static Volume CreateOrUpdate(this IVolumesOperations operations, Volume body, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.CreateOrUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Create or Update a volume - /// - /// - /// Create or update the specified volume within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IVolumesOperations operations, Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a volume - /// - /// - /// Patch the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static Volume Update(this IVolumesOperations operations, VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.UpdateAsync(body, resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Update a volume - /// - /// - /// Patch the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IVolumesOperations operations, VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a volume - /// - /// - /// Delete the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume - /// - public static void Delete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?)) - { - operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete).GetAwaiter().GetResult(); - } - - /// - /// Delete a volume - /// - /// - /// Delete the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Revert a volume to one of its snapshots - /// - /// - /// Revert a volume to the snapshot specified in the body - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Object for snapshot to revert supplied in the body of the operation. - /// - public static void Revert(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body) - { - operations.RevertAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Revert a volume to one of its snapshots - /// - /// - /// Revert a volume to the snapshot specified in the body - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Object for snapshot to revert supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task RevertAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reset cifs password - /// - /// - /// Reset cifs password from volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void ResetCifsPassword(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.ResetCifsPasswordAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Reset cifs password - /// - /// - /// Reset cifs password from volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task ResetCifsPasswordAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Break file locks - /// - /// - /// Break all the file locks on a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to provide the ability to clear file locks with selected - /// options - /// - public static VolumesBreakFileLocksHeaders BreakFileLocks(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest)) - { - return operations.BreakFileLocksAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Break file locks - /// - /// - /// Break all the file locks on a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to provide the ability to clear file locks with selected - /// options - /// - /// - /// The cancellation token. - /// - public static async Task BreakFileLocksAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BreakFileLocksWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Get Group Id List for LDAP User - /// - /// - /// Returns the list of group Ids for a specific LDAP User - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Returns group Id list for a specific LDAP user - /// - public static GetGroupIdListForLDAPUserResponse ListGetGroupIdListForLdapUser(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body) - { - return operations.ListGetGroupIdListForLdapUserAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Get Group Id List for LDAP User - /// - /// - /// Returns the list of group Ids for a specific LDAP User - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Returns group Id list for a specific LDAP user - /// - /// - /// The cancellation token. - /// - public static async Task ListGetGroupIdListForLdapUserAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListGetGroupIdListForLdapUserWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Break volume replication - /// - /// - /// Break the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to force break the replication. - /// - public static void BreakReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest)) - { - operations.BreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Break volume replication - /// - /// - /// Break the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to force break the replication. - /// - /// - /// The cancellation token. - /// - public static async Task BreakReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Re-establish volume replication - /// - /// - /// Re-establish a previously deleted replication between 2 volumes that have a - /// common ad-hoc or policy-based snapshots - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// body for the id of the source volume. - /// - public static void ReestablishReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body) - { - operations.ReestablishReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Re-establish volume replication - /// - /// - /// Re-establish a previously deleted replication between 2 volumes that have a - /// common ad-hoc or policy-based snapshots - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// body for the id of the source volume. - /// - /// - /// The cancellation token. - /// - public static async Task ReestablishReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Get volume replication status - /// - /// - /// Get the status of the replication - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static ReplicationStatus ReplicationStatusMethod(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.ReplicationStatusMethodAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Get volume replication status - /// - /// - /// Get the status of the replication - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task ReplicationStatusMethodAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ReplicationStatusMethodWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List replications for volume - /// - /// - /// List all replications for a specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static IEnumerable ListReplicationsMethod(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.ListReplicationsMethodAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// List replications for volume - /// - /// - /// List all replications for a specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task> ListReplicationsMethodAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListReplicationsMethodWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Resync volume replication - /// - /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void ResyncReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.ResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Resync volume replication - /// - /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task ResyncReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Delete volume replication - /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void DeleteReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.DeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Delete volume replication - /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task DeleteReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Authorize source volume replication - /// - /// - /// Authorize the replication connection on the source volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Authorize request object supplied in the body of the operation. - /// - public static void AuthorizeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body) - { - operations.AuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Authorize source volume replication - /// - /// - /// Authorize the replication connection on the source volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Authorize request object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task AuthorizeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.AuthorizeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// ReInitialize volume replication - /// - /// - /// Re-Initializes the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void ReInitializeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.ReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// ReInitialize volume replication - /// - /// - /// Re-Initializes the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task ReInitializeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ReInitializeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Change pool for volume - /// - /// - /// Moves volume to another pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// - public static void PoolChange(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body) - { - operations.PoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Change pool for volume - /// - /// - /// Moves volume to another pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task PoolChangeAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Relocate volume - /// - /// - /// Relocates volume to a new stamp - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Relocate volume request - /// - public static void Relocate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest)) - { - operations.RelocateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Relocate volume - /// - /// - /// Relocates volume to a new stamp - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Relocate volume request - /// - /// - /// The cancellation token. - /// - public static async Task RelocateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Finalize volume relocation - /// - /// - /// Finalizes the relocation of the volume and cleans up the old volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void FinalizeRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.FinalizeRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Finalize volume relocation - /// - /// - /// Finalizes the relocation of the volume and cleans up the old volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task FinalizeRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.FinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Revert volume relocation - /// - /// - /// Reverts the volume relocation process, cleans up the new volume and starts - /// using the former-existing volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void RevertRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.RevertRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Revert volume relocation - /// - /// - /// Reverts the volume relocation process, cleans up the new volume and starts - /// using the former-existing volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task RevertRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or Update a volume - /// - /// - /// Create or update the specified volume within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static Volume BeginCreateOrUpdate(this IVolumesOperations operations, Volume body, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.BeginCreateOrUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Create or Update a volume - /// - /// - /// Create or update the specified volume within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IVolumesOperations operations, Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a volume - /// - /// - /// Patch the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static Volume BeginUpdate(this IVolumesOperations operations, VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Update a volume - /// - /// - /// Patch the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// Volume object supplied in the body of the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IVolumesOperations operations, VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a volume - /// - /// - /// Delete the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume - /// - public static void BeginDelete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?)) - { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete).GetAwaiter().GetResult(); - } - - /// - /// Delete a volume - /// - /// - /// Delete the specified volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Revert a volume to one of its snapshots - /// - /// - /// Revert a volume to the snapshot specified in the body - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Object for snapshot to revert supplied in the body of the operation. - /// - public static void BeginRevert(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body) - { - operations.BeginRevertAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Revert a volume to one of its snapshots - /// - /// - /// Revert a volume to the snapshot specified in the body - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Object for snapshot to revert supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginRevertAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Reset cifs password - /// - /// - /// Reset cifs password from volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void BeginResetCifsPassword(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.BeginResetCifsPasswordAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Reset cifs password - /// - /// - /// Reset cifs password from volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginResetCifsPasswordAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Break file locks - /// - /// - /// Break all the file locks on a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to provide the ability to clear file locks with selected - /// options - /// - public static VolumesBreakFileLocksHeaders BeginBreakFileLocks(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest)) - { - return operations.BeginBreakFileLocksAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Break file locks - /// - /// - /// Break all the file locks on a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to provide the ability to clear file locks with selected - /// options - /// - /// - /// The cancellation token. - /// - public static async Task BeginBreakFileLocksAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginBreakFileLocksWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Get Group Id List for LDAP User - /// - /// - /// Returns the list of group Ids for a specific LDAP User - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Returns group Id list for a specific LDAP user - /// - public static GetGroupIdListForLDAPUserResponse BeginListGetGroupIdListForLdapUser(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body) - { - return operations.BeginListGetGroupIdListForLdapUserAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Get Group Id List for LDAP User - /// - /// - /// Returns the list of group Ids for a specific LDAP User - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Returns group Id list for a specific LDAP user - /// - /// - /// The cancellation token. - /// - public static async Task BeginListGetGroupIdListForLdapUserAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLDAPUserRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Break volume replication - /// - /// - /// Break the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to force break the replication. - /// - public static void BeginBreakReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest)) - { - operations.BeginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Break volume replication - /// - /// - /// Break the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Optional body to force break the replication. - /// - /// - /// The cancellation token. - /// - public static async Task BeginBreakReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginBreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Re-establish volume replication - /// - /// - /// Re-establish a previously deleted replication between 2 volumes that have a - /// common ad-hoc or policy-based snapshots - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// body for the id of the source volume. - /// - public static void BeginReestablishReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body) - { - operations.BeginReestablishReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Re-establish volume replication - /// - /// - /// Re-establish a previously deleted replication between 2 volumes that have a - /// common ad-hoc or policy-based snapshots - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// body for the id of the source volume. - /// - /// - /// The cancellation token. - /// - public static async Task BeginReestablishReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Resync volume replication - /// - /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void BeginResyncReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.BeginResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Resync volume replication - /// - /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginResyncReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Delete volume replication - /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void BeginDeleteReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.BeginDeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Delete volume replication - /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Authorize source volume replication - /// - /// - /// Authorize the replication connection on the source volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Authorize request object supplied in the body of the operation. - /// - public static void BeginAuthorizeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body) - { - operations.BeginAuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Authorize source volume replication - /// - /// - /// Authorize the replication connection on the source volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Authorize request object supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginAuthorizeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginAuthorizeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// ReInitialize volume replication - /// - /// - /// Re-Initializes the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void BeginReInitializeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.BeginReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// ReInitialize volume replication - /// - /// - /// Re-Initializes the replication connection on the destination volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginReInitializeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginReInitializeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Change pool for volume - /// - /// - /// Moves volume to another pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// - public static void BeginPoolChange(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body) - { - operations.BeginPoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Change pool for volume - /// - /// - /// Moves volume to another pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginPoolChangeAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginPoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Relocate volume - /// - /// - /// Relocates volume to a new stamp - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Relocate volume request - /// - public static void BeginRelocate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest)) - { - operations.BeginRelocateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); - } - - /// - /// Relocate volume - /// - /// - /// Relocates volume to a new stamp - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Relocate volume request - /// - /// - /// The cancellation token. - /// - public static async Task BeginRelocateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Finalize volume relocation - /// - /// - /// Finalizes the relocation of the volume and cleans up the old volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void BeginFinalizeRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.BeginFinalizeRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Finalize volume relocation - /// - /// - /// Finalizes the relocation of the volume and cleans up the old volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginFinalizeRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginFinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Revert volume relocation - /// - /// - /// Reverts the volume relocation process, cleans up the new volume and starts - /// using the former-existing volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static void BeginRevertRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - operations.BeginRevertRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Revert volume relocation - /// - /// - /// Reverts the volume relocation process, cleans up the new volume and starts - /// using the former-existing volume. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task BeginRevertRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginRevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Describe all volumes - /// - /// - /// List all volumes within the capacity pool - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IVolumesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Describe all volumes - /// - /// - /// List all volumes within the capacity pool - /// - /// - /// 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 IVolumesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + /// + /// List all volumes within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + public static Microsoft.Rest.Azure.IPage List(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName) + { + return ((IVolumesOperations)operations).ListAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); + } + + /// + /// List all volumes within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get the details of the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static Volume Get(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IVolumesOperations)operations).GetAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Get the details of the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Create or update the specified volume within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static Volume CreateOrUpdate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, Volume body) + { + return ((IVolumesOperations)operations).CreateOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Create or update the specified volume within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, Volume body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Patch the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static Volume Update(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body) + { + return ((IVolumesOperations)operations).UpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Patch the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// An option to force delete the volume. Will cleanup resources connected to the particular volume + /// + public static void Delete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?)) + { + ((IVolumesOperations)operations).DeleteAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete).GetAwaiter().GetResult(); + } + + /// + /// Delete the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// An option to force delete the volume. Will cleanup resources connected to the particular volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Revert a volume to the snapshot specified in the body + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void Revert(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body) + { + ((IVolumesOperations)operations).RevertAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Revert a volume to the snapshot specified in the body + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RevertAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reset cifs password from volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void ResetCifsPassword(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).ResetCifsPasswordAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Reset cifs password from volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResetCifsPasswordAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Break all the file locks on a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static VolumesBreakFileLocksHeaders BreakFileLocks(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest)) + { + return ((IVolumesOperations)operations).BreakFileLocksAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Break all the file locks on a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BreakFileLocksAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BreakFileLocksWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Returns the list of group Ids for a specific LDAP User + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static GetGroupIdListForLdapUserResponse ListGetGroupIdListForLdapUser(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body) + { + return ((IVolumesOperations)operations).ListGetGroupIdListForLdapUserAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of group Ids for a specific LDAP User + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListGetGroupIdListForLdapUserAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListGetGroupIdListForLdapUserWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Break the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BreakReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest)) + { + ((IVolumesOperations)operations).BreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Break the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BreakReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void ReestablishReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body) + { + ((IVolumesOperations)operations).ReestablishReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReestablishReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Get the status of the replication + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static ReplicationStatus ReplicationStatus(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IVolumesOperations)operations).ReplicationStatusAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Get the status of the replication + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReplicationStatusAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ReplicationStatusWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List all replications for a specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static System.Collections.Generic.IEnumerable ListReplications(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return ((IVolumesOperations)operations).ListReplicationsAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// List all replications for a specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListReplicationsAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListReplicationsWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void ResyncReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).ResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ResyncReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Delete the replication connection on the destination volume, and send release to the source replication + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void DeleteReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).DeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Delete the replication connection on the destination volume, and send release to the source replication + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Authorize the replication connection on the source volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void AuthorizeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body) + { + ((IVolumesOperations)operations).AuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Authorize the replication connection on the source volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AuthorizeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.AuthorizeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Re-Initializes the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void ReInitializeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).ReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Re-Initializes the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ReInitializeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.ReInitializeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Moves volume to another pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void PoolChange(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body) + { + ((IVolumesOperations)operations).PoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Moves volume to another pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PoolChangeAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.PoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Relocates volume to a new stamp + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void Relocate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest)) + { + ((IVolumesOperations)operations).RelocateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Relocates volume to a new stamp + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RelocateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Finalizes the relocation of the volume and cleans up the old volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void FinalizeRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).FinalizeRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Finalizes the relocation of the volume and cleans up the old volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task FinalizeRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.FinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void RevertRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).RevertRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RevertRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.RevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Create or update the specified volume within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static Volume BeginCreateOrUpdate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, Volume body) + { + return ((IVolumesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Create or update the specified volume within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, Volume body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Patch the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static Volume BeginUpdate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body) + { + return ((IVolumesOperations)operations).BeginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Patch the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumePatch body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Delete the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// An option to force delete the volume. Will cleanup resources connected to the particular volume + /// + public static void BeginDelete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?)) + { + ((IVolumesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete).GetAwaiter().GetResult(); + } + + /// + /// Delete the specified volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// An option to force delete the volume. Will cleanup resources connected to the particular volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Revert a volume to the snapshot specified in the body + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginRevert(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body) + { + ((IVolumesOperations)operations).BeginRevertAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Revert a volume to the snapshot specified in the body + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRevertAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reset cifs password from volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginResetCifsPassword(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).BeginResetCifsPasswordAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Reset cifs password from volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResetCifsPasswordAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Break all the file locks on a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static VolumesBreakFileLocksHeaders BeginBreakFileLocks(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest)) + { + return ((IVolumesOperations)operations).BeginBreakFileLocksAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Break all the file locks on a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginBreakFileLocksAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakFileLocksRequest body = default(BreakFileLocksRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginBreakFileLocksWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Returns the list of group Ids for a specific LDAP User + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static GetGroupIdListForLdapUserResponse BeginListGetGroupIdListForLdapUser(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body) + { + return ((IVolumesOperations)operations).BeginListGetGroupIdListForLdapUserAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of group Ids for a specific LDAP User + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginListGetGroupIdListForLdapUserAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, GetGroupIdListForLdapUserRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginListGetGroupIdListForLdapUserWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Break the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginBreakReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest)) + { + ((IVolumesOperations)operations).BeginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Break the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginBreakReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginBreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginReestablishReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body) + { + ((IVolumesOperations)operations).BeginReestablishReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based snapshots + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReestablishReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginResyncReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).BeginResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginResyncReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Delete the replication connection on the destination volume, and send release to the source replication + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginDeleteReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).BeginDeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Delete the replication connection on the destination volume, and send release to the source replication + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Authorize the replication connection on the source volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginAuthorizeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body) + { + ((IVolumesOperations)operations).BeginAuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Authorize the replication connection on the source volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginAuthorizeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginAuthorizeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Re-Initializes the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginReInitializeReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).BeginReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Re-Initializes the replication connection on the destination volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginReInitializeReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginReInitializeReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Moves volume to another pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginPoolChange(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body) + { + ((IVolumesOperations)operations).BeginPoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Moves volume to another pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginPoolChangeAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginPoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Relocates volume to a new stamp + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginRelocate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest)) + { + ((IVolumesOperations)operations).BeginRelocateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Relocates volume to a new stamp + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRelocateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Finalizes the relocation of the volume and cleans up the old volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginFinalizeRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).BeginFinalizeRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Finalizes the relocation of the volume and cleans up the old volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginFinalizeRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginFinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static void BeginRevertRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + ((IVolumesOperations)operations).BeginRevertRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Reverts the volume relocation process, cleans up the new volume and starts using the former-existing volume. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginRevertRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginRevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// List all volumes within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IVolumesOperations operations, string nextPageLink) + { + return ((IVolumesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all volumes within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IVolumesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/README.md b/src/NetAppFiles/NetAppFiles.Management.Sdk/README.md index ce67ffc7b42b..6475411cc15c 100644 --- a/src/NetAppFiles/NetAppFiles.Management.Sdk/README.md +++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/README.md @@ -5,14 +5,14 @@ This directory contains management plane service clients of Az.NetAppFiles modul In this directory, run AutoRest: ``` autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true openapi-type: arm diff --git a/src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs b/src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs index 21ad0bd23283..cd89a7b8ea81 100644 --- a/src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs +++ b/src/NetAppFiles/NetAppFiles/Account/NewNetAppFilesAccount.cs @@ -113,7 +113,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfAccount = AzureNetAppFilesManagementClient.Accounts.CreateOrUpdate(netAppAccountBody, ResourceGroupName, Name); + var anfAccount = AzureNetAppFilesManagementClient.Accounts.CreateOrUpdate(ResourceGroupName, Name, netAppAccountBody); WriteObject(anfAccount.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs b/src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs index 9b1100654a2b..509ce8c593ea 100644 --- a/src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs +++ b/src/NetAppFiles/NetAppFiles/Account/SetNetAppFilesAccount.cs @@ -111,7 +111,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfAccount = AzureNetAppFilesManagementClient.Accounts.CreateOrUpdate(netAppAccountBody, ResourceGroupName, Name); + var anfAccount = AzureNetAppFilesManagementClient.Accounts.CreateOrUpdate(ResourceGroupName, Name, netAppAccountBody); WriteObject(anfAccount.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs b/src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs index a9b05932ab92..815019d0d3cf 100644 --- a/src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs +++ b/src/NetAppFiles/NetAppFiles/Account/UpdateNetAppFilesAccount.cs @@ -121,7 +121,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName))) { - var anfAccount = AzureNetAppFilesManagementClient.Accounts.Update(netAppAccountBody, ResourceGroupName, Name); + var anfAccount = AzureNetAppFilesManagementClient.Accounts.Update(ResourceGroupName, Name, netAppAccountBody); WriteObject(anfAccount.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/ActiveDirectory/NewNetAppFilesActiveDirectory.cs b/src/NetAppFiles/NetAppFiles/ActiveDirectory/NewNetAppFilesActiveDirectory.cs index ea2bfaae7c95..e72fbc6233b3 100644 --- a/src/NetAppFiles/NetAppFiles/ActiveDirectory/NewNetAppFilesActiveDirectory.cs +++ b/src/NetAppFiles/NetAppFiles/ActiveDirectory/NewNetAppFilesActiveDirectory.cs @@ -216,14 +216,14 @@ public override void ExecuteCmdlet() OrganizationalUnit = OrganizationalUnit, BackupOperators = BackupOperator, KdcIP = KdcIP, - ServerRootCACertificate = ServerRootCACertificate, + ServerRootCaCertificate = ServerRootCACertificate, SecurityOperators = SecurityOperator, AesEncryption = AesEncryption, LdapSigning = LdapSigning, - LdapOverTLS = LdapOverTLS, + LdapOverTls = LdapOverTLS, AllowLocalNfsUsersWithLdap = AllowLocalNfsUsersWithLdap, Administrators = Administrator, - EncryptDCConnections = EncryptDCConnection, + EncryptDcConnections = EncryptDCConnection, LdapSearchScope = LdapSearchScope?.ConvertFromPs(), PreferredServersForLdapClient = PreferredServersForLdapClient is null ? null : string.Join(",", PreferredServersForLdapClient), }; @@ -236,7 +236,7 @@ public override void ExecuteCmdlet() { ActiveDirectories = anfAccount.ActiveDirectories }; - var updatedAnfAccount = AzureNetAppFilesManagementClient.Accounts.Update(netAppAccountBody, ResourceGroupName, AccountName); + var updatedAnfAccount = AzureNetAppFilesManagementClient.Accounts.Update(ResourceGroupName, AccountName, netAppAccountBody); var updatedActiveDirectory = updatedAnfAccount.ActiveDirectories.FirstOrDefault(e => e.SmbServerName == SmbServerName); WriteObject(updatedActiveDirectory.ConvertToPs(ResourceGroupName, AccountName)); } diff --git a/src/NetAppFiles/NetAppFiles/ActiveDirectory/RemoveNetAppFilesActiveDirectory.cs b/src/NetAppFiles/NetAppFiles/ActiveDirectory/RemoveNetAppFilesActiveDirectory.cs index 318e264577ed..ed3f5b0bbfd4 100644 --- a/src/NetAppFiles/NetAppFiles/ActiveDirectory/RemoveNetAppFilesActiveDirectory.cs +++ b/src/NetAppFiles/NetAppFiles/ActiveDirectory/RemoveNetAppFilesActiveDirectory.cs @@ -108,7 +108,7 @@ public override void ExecuteCmdlet() var anfAccount = AzureNetAppFilesManagementClient.Accounts.Get(ResourceGroupName, AccountName); var activeDirectory = anfAccount.ActiveDirectories.FirstOrDefault(a => a.ActiveDirectoryId == ActiveDirectoryId); anfAccount.ActiveDirectories.Remove(activeDirectory); - var updatedAnfAccount = AzureNetAppFilesManagementClient.Accounts.BeginCreateOrUpdate(anfAccount, ResourceGroupName, AccountName); + var updatedAnfAccount = AzureNetAppFilesManagementClient.Accounts.BeginCreateOrUpdate(ResourceGroupName, AccountName, anfAccount); success = true; } if (PassThru) diff --git a/src/NetAppFiles/NetAppFiles/ActiveDirectory/UpdateNetAppFilesActiveDirectory.cs b/src/NetAppFiles/NetAppFiles/ActiveDirectory/UpdateNetAppFilesActiveDirectory.cs index b8c73d158fba..900609123195 100644 --- a/src/NetAppFiles/NetAppFiles/ActiveDirectory/UpdateNetAppFilesActiveDirectory.cs +++ b/src/NetAppFiles/NetAppFiles/ActiveDirectory/UpdateNetAppFilesActiveDirectory.cs @@ -259,7 +259,7 @@ public override void ExecuteCmdlet() anfADConfig.OrganizationalUnit = OrganizationalUnit ?? anfADConfig.Site; anfADConfig.BackupOperators = BackupOperator ?? anfADConfig.BackupOperators; anfADConfig.KdcIP = KdcIP ?? anfADConfig.KdcIP; - anfADConfig.ServerRootCACertificate = ServerRootCACertificate ?? anfADConfig.ServerRootCACertificate; + anfADConfig.ServerRootCaCertificate = ServerRootCACertificate ?? anfADConfig.ServerRootCaCertificate; anfADConfig.SecurityOperators = SecurityOperator ?? anfADConfig.SecurityOperators; if (AesEncryption) { @@ -271,7 +271,7 @@ public override void ExecuteCmdlet() } if (LdapOverTLS) { - anfADConfig.LdapOverTLS = LdapOverTLS; + anfADConfig.LdapOverTls = LdapOverTLS; } if (AllowLocalNfsUsersWithLdap) { @@ -280,7 +280,7 @@ public override void ExecuteCmdlet() anfADConfig.Administrators = Administrator ?? anfADConfig.Administrators; if (EncryptDCConnection) { - anfADConfig.EncryptDCConnections = EncryptDCConnection; + anfADConfig.EncryptDcConnections = EncryptDCConnection; } anfADConfig.LdapSearchScope = LdapSearchScope?.ConvertFromPs(); anfADConfig.PreferredServersForLdapClient = PreferredServersForLdapClient is null ? null : string.Join(",", PreferredServersForLdapClient); @@ -289,7 +289,7 @@ public override void ExecuteCmdlet() { ActiveDirectories = anfAccount.ActiveDirectories }; - var updatedAnfAccount = AzureNetAppFilesManagementClient.Accounts.Update(netAppAccountBody, ResourceGroupName, AccountName); + var updatedAnfAccount = AzureNetAppFilesManagementClient.Accounts.Update(ResourceGroupName, AccountName, netAppAccountBody); var updatedActiveDirectory = updatedAnfAccount.ActiveDirectories.FirstOrDefault(e => e.ActiveDirectoryId == ActiveDirectoryId); WriteObject(updatedActiveDirectory.ConvertToPs(ResourceGroupName, AccountName)); } diff --git a/src/NetAppFiles/NetAppFiles/ChangeLog.md b/src/NetAppFiles/NetAppFiles/ChangeLog.md index 126a16a39613..83ccc72e417f 100644 --- a/src/NetAppFiles/NetAppFiles/ChangeLog.md +++ b/src/NetAppFiles/NetAppFiles/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed some minor issues ## Version 0.13.1 * Updated Azure.Core to 1.34.0. diff --git a/src/NetAppFiles/NetAppFiles/Common/AzureNetAppFilesCmdletBase.cs b/src/NetAppFiles/NetAppFiles/Common/AzureNetAppFilesCmdletBase.cs index bfbb98075071..52c7bff87410 100644 --- a/src/NetAppFiles/NetAppFiles/Common/AzureNetAppFilesCmdletBase.cs +++ b/src/NetAppFiles/NetAppFiles/Common/AzureNetAppFilesCmdletBase.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Commands.NetAppFiles.Common /// public class AzureNetAppFilesCmdletBase : AzureRMCmdlet { - private IAzureNetAppFilesManagementClient _netAppFilesManagementClient; + private INetAppManagementClient _netAppFilesManagementClient; protected const string ResourceIdParameterSet = "ByResourceIdParameterSet"; protected const string ObjectParameterSet = "ByObjectParameterSet"; @@ -35,12 +35,12 @@ public class AzureNetAppFilesCmdletBase : AzureRMCmdlet /// /// Gets or sets the Azure NetApp Files management client. /// - public IAzureNetAppFilesManagementClient AzureNetAppFilesManagementClient + public INetAppManagementClient AzureNetAppFilesManagementClient { get => _netAppFilesManagementClient ?? (_netAppFilesManagementClient = - AzureSession.Instance.ClientFactory.CreateArmClient(DefaultProfile.DefaultContext, + AzureSession.Instance.ClientFactory.CreateArmClient(DefaultProfile.DefaultContext, AzureEnvironment.Endpoint.ResourceManager)); set { _netAppFilesManagementClient = value; } } diff --git a/src/NetAppFiles/NetAppFiles/Helpers/GroupIdsForLdapUserExtensions.cs b/src/NetAppFiles/NetAppFiles/Helpers/GroupIdsForLdapUserExtensions.cs index c7a1cf199a97..a95f849b7c59 100644 --- a/src/NetAppFiles/NetAppFiles/Helpers/GroupIdsForLdapUserExtensions.cs +++ b/src/NetAppFiles/NetAppFiles/Helpers/GroupIdsForLdapUserExtensions.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Commands.NetAppFiles.Helpers { public static class GroupIdsForLdapUserExtensions { - public static PSGetGroupIdListForLDAPUserResponse ConvertToPs(this Management.NetApp.Models.GetGroupIdListForLDAPUserResponse getGroupIdListForLDAPUserResponse) + public static PSGetGroupIdListForLDAPUserResponse ConvertToPs(this Management.NetApp.Models.GetGroupIdListForLdapUserResponse getGroupIdListForLDAPUserResponse) { var psGetGroupIdListForLDAPUser = new PSGetGroupIdListForLDAPUserResponse() { diff --git a/src/NetAppFiles/NetAppFiles/Helpers/LdapSearchScopeOptExtensions.cs b/src/NetAppFiles/NetAppFiles/Helpers/LdapSearchScopeOptExtensions.cs index 632f8795138f..544c462db060 100644 --- a/src/NetAppFiles/NetAppFiles/Helpers/LdapSearchScopeOptExtensions.cs +++ b/src/NetAppFiles/NetAppFiles/Helpers/LdapSearchScopeOptExtensions.cs @@ -26,9 +26,9 @@ public static PSNetAppFilesLdapSearchScopeOpt ConvertToPs(this LdapSearchScopeOp { var psLdapSearchScope = new PSNetAppFilesLdapSearchScopeOpt { - GroupDN = ldapSearchScope.GroupDN, + GroupDN = ldapSearchScope.GroupDn, GroupMembershipFilter = ldapSearchScope.GroupMembershipFilter, - UserDN = ldapSearchScope.UserDN + UserDN = ldapSearchScope.UserDn }; return psLdapSearchScope; } @@ -37,9 +37,9 @@ public static LdapSearchScopeOpt ConvertFromPs(this PSNetAppFilesLdapSearchScope { var ldapSearchScope = new LdapSearchScopeOpt { - GroupDN = psLdapSearchScope.GroupDN, + GroupDn = psLdapSearchScope.GroupDN, GroupMembershipFilter = psLdapSearchScope.GroupMembershipFilter, - UserDN = psLdapSearchScope.UserDN + UserDn = psLdapSearchScope.UserDN }; return ldapSearchScope; } diff --git a/src/NetAppFiles/NetAppFiles/Helpers/ModelExtensions.cs b/src/NetAppFiles/NetAppFiles/Helpers/ModelExtensions.cs index f646ee697a3d..c157a9e080bd 100644 --- a/src/NetAppFiles/NetAppFiles/Helpers/ModelExtensions.cs +++ b/src/NetAppFiles/NetAppFiles/Helpers/ModelExtensions.cs @@ -37,14 +37,14 @@ public static class ModelExtensions BackupOperators = psActiveDirectory.BackupOperators, KdcIP = psActiveDirectory.KdcIP, AdName = psActiveDirectory.AdName, - ServerRootCACertificate = psActiveDirectory.ServerRootCACertificate, + ServerRootCaCertificate = psActiveDirectory.ServerRootCACertificate, AesEncryption = psActiveDirectory.AesEncryption, LdapSigning = psActiveDirectory.LdapSigning, SecurityOperators = psActiveDirectory.SecurityOperators, - LdapOverTLS = psActiveDirectory.LdapOverTLS, + LdapOverTls = psActiveDirectory.LdapOverTLS, AllowLocalNfsUsersWithLdap = psActiveDirectory.AllowLocalNfsUsersWithLdap, Administrators = psActiveDirectory.Administrators, - EncryptDCConnections = psActiveDirectory.EncryptDCConnections, + EncryptDcConnections = psActiveDirectory.EncryptDCConnections, PreferredServersForLdapClient = psActiveDirectory.PreferredServersForLdapClient is null ? null: string.Join(",", psActiveDirectory.PreferredServersForLdapClient), LdapSearchScope = psActiveDirectory.LdapSearchScope?.ConvertFromPs() }).ToList(); @@ -74,14 +74,14 @@ public static PSNetAppFilesActiveDirectory ConvertToPs(this Management.NetApp.Mo BackupOperators = activeDirectory.BackupOperators, KdcIP = activeDirectory.KdcIP, AdName = activeDirectory.AdName, - ServerRootCACertificate = activeDirectory.ServerRootCACertificate, + ServerRootCACertificate = activeDirectory.ServerRootCaCertificate, AesEncryption = activeDirectory.AesEncryption, LdapSigning = activeDirectory.LdapSigning, SecurityOperators = activeDirectory.SecurityOperators, - LdapOverTLS = activeDirectory.LdapOverTLS, + LdapOverTLS = activeDirectory.LdapOverTls, AllowLocalNfsUsersWithLdap = activeDirectory.AllowLocalNfsUsersWithLdap, Administrators = activeDirectory.Administrators, - EncryptDCConnections = activeDirectory.EncryptDCConnections, + EncryptDCConnections = activeDirectory.EncryptDcConnections, LdapSearchScope = activeDirectory.LdapSearchScope.ConvertToPs(), PreferredServersForLdapClient = activeDirectory.PreferredServersForLdapClient?.Split(',').ToList() }; @@ -146,10 +146,10 @@ public static VolumePatchPropertiesExportPolicy ConvertExportPolicyPatchFromPs(P Nfsv41 = rule.Nfsv41, AllowedClients = rule.AllowedClients, HasRootAccess = rule.HasRootAccess, - Kerberos5iReadOnly = rule.Kerberos5iReadOnly, - Kerberos5iReadWrite = rule.Kerberos5iReadWrite, - Kerberos5pReadOnly = rule.Kerberos5pReadOnly, - Kerberos5pReadWrite = rule.Kerberos5pReadWrite, + Kerberos5IReadOnly = rule.Kerberos5iReadOnly, + Kerberos5IReadWrite = rule.Kerberos5iReadWrite, + Kerberos5PReadOnly = rule.Kerberos5pReadOnly, + Kerberos5PReadWrite = rule.Kerberos5pReadWrite, Kerberos5ReadOnly = rule.Kerberos5ReadOnly, Kerberos5ReadWrite = rule.Kerberos5ReadWrite, }; @@ -176,10 +176,10 @@ public static VolumePropertiesExportPolicy ConvertExportPolicyFromPs(PSNetAppFil Nfsv41 = rule.Nfsv41, AllowedClients = rule.AllowedClients, HasRootAccess = rule.HasRootAccess, - Kerberos5iReadOnly = rule.Kerberos5iReadOnly, - Kerberos5iReadWrite = rule.Kerberos5iReadWrite, - Kerberos5pReadOnly = rule.Kerberos5pReadOnly, - Kerberos5pReadWrite = rule.Kerberos5pReadWrite, + Kerberos5IReadOnly = rule.Kerberos5iReadOnly, + Kerberos5IReadWrite = rule.Kerberos5iReadWrite, + Kerberos5PReadOnly = rule.Kerberos5pReadOnly, + Kerberos5PReadWrite = rule.Kerberos5pReadWrite, Kerberos5ReadOnly = rule.Kerberos5ReadOnly, Kerberos5ReadWrite = rule.Kerberos5ReadWrite, }; @@ -207,10 +207,10 @@ public static PSNetAppFilesVolumeExportPolicy ConvertExportPolicyToPs(VolumeProp Nfsv41 = Rule.Nfsv41, AllowedClients = Rule.AllowedClients, HasRootAccess = Rule.HasRootAccess, - Kerberos5iReadOnly = Rule.Kerberos5iReadOnly, - Kerberos5iReadWrite = Rule.Kerberos5iReadWrite, - Kerberos5pReadOnly = Rule.Kerberos5pReadOnly, - Kerberos5pReadWrite = Rule.Kerberos5pReadWrite, + Kerberos5iReadOnly = Rule.Kerberos5IReadOnly, + Kerberos5iReadWrite = Rule.Kerberos5IReadWrite, + Kerberos5pReadOnly = Rule.Kerberos5PReadOnly, + Kerberos5pReadWrite = Rule.Kerberos5PReadWrite, Kerberos5ReadOnly = Rule.Kerberos5ReadOnly, Kerberos5ReadWrite = Rule.Kerberos5ReadWrite }; diff --git a/src/NetAppFiles/NetAppFiles/Pool/NewNetAppFilesPool.cs b/src/NetAppFiles/NetAppFiles/Pool/NewNetAppFilesPool.cs index eb266586a738..5869df6232db 100644 --- a/src/NetAppFiles/NetAppFiles/Pool/NewNetAppFilesPool.cs +++ b/src/NetAppFiles/NetAppFiles/Pool/NewNetAppFilesPool.cs @@ -167,7 +167,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfPool = AzureNetAppFilesManagementClient.Pools.CreateOrUpdate(capacityPoolBody, ResourceGroupName, AccountName, Name); + var anfPool = AzureNetAppFilesManagementClient.Pools.CreateOrUpdate(ResourceGroupName, AccountName, Name, capacityPoolBody); WriteObject(anfPool.ToPsNetAppFilesPool()); } } diff --git a/src/NetAppFiles/NetAppFiles/Pool/SetNetAppFilesPool.cs b/src/NetAppFiles/NetAppFiles/Pool/SetNetAppFilesPool.cs index 554b3bda40d8..f35833320792 100644 --- a/src/NetAppFiles/NetAppFiles/Pool/SetNetAppFilesPool.cs +++ b/src/NetAppFiles/NetAppFiles/Pool/SetNetAppFilesPool.cs @@ -174,7 +174,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName))) { - var anfPool = AzureNetAppFilesManagementClient.Pools.CreateOrUpdate(capacityPoolBody, ResourceGroupName, AccountName, Name); + var anfPool = AzureNetAppFilesManagementClient.Pools.CreateOrUpdate(ResourceGroupName, AccountName, Name, capacityPoolBody); WriteObject(anfPool.ToPsNetAppFilesPool()); } } diff --git a/src/NetAppFiles/NetAppFiles/Pool/UpdateNetAppFilesPool.cs b/src/NetAppFiles/NetAppFiles/Pool/UpdateNetAppFilesPool.cs index c6676fbad34a..88762ecc630c 100644 --- a/src/NetAppFiles/NetAppFiles/Pool/UpdateNetAppFilesPool.cs +++ b/src/NetAppFiles/NetAppFiles/Pool/UpdateNetAppFilesPool.cs @@ -172,7 +172,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName))) { - var anfPool = AzureNetAppFilesManagementClient.Pools.Update(capacityPoolBody, ResourceGroupName, AccountName, Name).ToPsNetAppFilesPool(); + var anfPool = AzureNetAppFilesManagementClient.Pools.Update(ResourceGroupName, AccountName, Name, capacityPoolBody).ToPsNetAppFilesPool(); WriteObject(anfPool); } } diff --git a/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesReplicationStatus.cs b/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesReplicationStatus.cs index faf172df9555..22ab481db74d 100644 --- a/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesReplicationStatus.cs +++ b/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesReplicationStatus.cs @@ -108,7 +108,7 @@ public override void ExecuteCmdlet() Name = NameParts[2]; } - var anfReplicationStatus = AzureNetAppFilesManagementClient.Volumes.ReplicationStatusMethod(ResourceGroupName, AccountName, PoolName, Name); + var anfReplicationStatus = AzureNetAppFilesManagementClient.Volumes.ReplicationStatus(ResourceGroupName, AccountName, PoolName, Name); WriteObject(anfReplicationStatus.ToPsNetAppFilesReplicationStatus()); } } diff --git a/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesVolumeReplications.cs b/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesVolumeReplications.cs index db1426bebe2e..2dfe6878db89 100644 --- a/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesVolumeReplications.cs +++ b/src/NetAppFiles/NetAppFiles/Replication/GetNetAppFilesVolumeReplications.cs @@ -108,7 +108,7 @@ public override void ExecuteCmdlet() PoolName = NameParts[1]; } - var volumeReplications = AzureNetAppFilesManagementClient.Volumes.ListReplicationsMethod(ResourceGroupName, AccountName, PoolName, Name).Select(e => e.ConvertToPs()); + var volumeReplications = AzureNetAppFilesManagementClient.Volumes.ListReplications(ResourceGroupName, AccountName, PoolName, Name).Select(e => e.ConvertToPs()); WriteObject(volumeReplications, true); } } diff --git a/src/NetAppFiles/NetAppFiles/Snapshot/NewNetAppFilesSnapshot.cs b/src/NetAppFiles/NetAppFiles/Snapshot/NewNetAppFilesSnapshot.cs index 4ef23d398d7e..2bf7599d0a46 100644 --- a/src/NetAppFiles/NetAppFiles/Snapshot/NewNetAppFilesSnapshot.cs +++ b/src/NetAppFiles/NetAppFiles/Snapshot/NewNetAppFilesSnapshot.cs @@ -134,7 +134,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfSnapshot = AzureNetAppFilesManagementClient.Snapshots.Create(snapshotBody, ResourceGroupName, AccountName, PoolName, VolumeName, Name); + var anfSnapshot = AzureNetAppFilesManagementClient.Snapshots.Create(ResourceGroupName, AccountName, PoolName, VolumeName, Name, snapshotBody); WriteObject(anfSnapshot.ToPsNetAppFilesSnapshot()); } } diff --git a/src/NetAppFiles/NetAppFiles/Snapshot/RestoreNetAppFilesSnapshotFiles.cs b/src/NetAppFiles/NetAppFiles/Snapshot/RestoreNetAppFilesSnapshotFiles.cs index ad043e3fff39..a561ff485d21 100644 --- a/src/NetAppFiles/NetAppFiles/Snapshot/RestoreNetAppFilesSnapshotFiles.cs +++ b/src/NetAppFiles/NetAppFiles/Snapshot/RestoreNetAppFilesSnapshotFiles.cs @@ -154,7 +154,7 @@ public override void ExecuteCmdlet() DestinationPath = DestinationPath }; - AzureNetAppFilesManagementClient.Snapshots.RestoreFiles(snapshotRestoreFilesBody, ResourceGroupName, AccountName, PoolName, VolumeName, Name); + AzureNetAppFilesManagementClient.Snapshots.RestoreFiles(ResourceGroupName, AccountName, PoolName, VolumeName, Name, snapshotRestoreFilesBody); success = true; } if (PassThru.IsPresent) diff --git a/src/NetAppFiles/NetAppFiles/SnapshotPolicy/NewNetAppFilesSnapshotPolicy.cs b/src/NetAppFiles/NetAppFiles/SnapshotPolicy/NewNetAppFilesSnapshotPolicy.cs index a1087343a876..ce18d234e52b 100644 --- a/src/NetAppFiles/NetAppFiles/SnapshotPolicy/NewNetAppFilesSnapshotPolicy.cs +++ b/src/NetAppFiles/NetAppFiles/SnapshotPolicy/NewNetAppFilesSnapshotPolicy.cs @@ -152,7 +152,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfSnapshotPolicy = AzureNetAppFilesManagementClient.SnapshotPolicies.Create(snapshotPolicyBody, ResourceGroupName, AccountName, snapshotPolicyName: Name); + var anfSnapshotPolicy = AzureNetAppFilesManagementClient.SnapshotPolicies.Create(ResourceGroupName, AccountName, snapshotPolicyName: Name, snapshotPolicyBody); WriteObject(anfSnapshotPolicy.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/SnapshotPolicy/SetNetAppFilesSnapshotPolicy.cs b/src/NetAppFiles/NetAppFiles/SnapshotPolicy/SetNetAppFilesSnapshotPolicy.cs index 6a6dc6e128cb..8d7279268024 100644 --- a/src/NetAppFiles/NetAppFiles/SnapshotPolicy/SetNetAppFilesSnapshotPolicy.cs +++ b/src/NetAppFiles/NetAppFiles/SnapshotPolicy/SetNetAppFilesSnapshotPolicy.cs @@ -167,7 +167,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName))) { - var anfSnapshotPolicy = AzureNetAppFilesManagementClient.SnapshotPolicies.Create(snapshotPolicyBody, ResourceGroupName, AccountName, snapshotPolicyName: Name); + var anfSnapshotPolicy = AzureNetAppFilesManagementClient.SnapshotPolicies.Create(ResourceGroupName, AccountName, snapshotPolicyName: Name, snapshotPolicyBody); WriteObject(anfSnapshotPolicy.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/SnapshotPolicy/UpdateNetAppFilesSnapshotPolicy.cs b/src/NetAppFiles/NetAppFiles/SnapshotPolicy/UpdateNetAppFilesSnapshotPolicy.cs index 654fe8cc3ee4..56b028891910 100644 --- a/src/NetAppFiles/NetAppFiles/SnapshotPolicy/UpdateNetAppFilesSnapshotPolicy.cs +++ b/src/NetAppFiles/NetAppFiles/SnapshotPolicy/UpdateNetAppFilesSnapshotPolicy.cs @@ -173,7 +173,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfSnapshotPolicy = AzureNetAppFilesManagementClient.SnapshotPolicies.Update(snapshotPolicyPatch, ResourceGroupName, AccountName, snapshotPolicyName: Name); + var anfSnapshotPolicy = AzureNetAppFilesManagementClient.SnapshotPolicies.Update(ResourceGroupName, AccountName, snapshotPolicyName: Name, snapshotPolicyPatch); WriteObject(anfSnapshotPolicy.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/Subvolume/NewNetAppFilesSubvolume.cs b/src/NetAppFiles/NetAppFiles/Subvolume/NewNetAppFilesSubvolume.cs index 57bf80c83619..17de1c91c868 100644 --- a/src/NetAppFiles/NetAppFiles/Subvolume/NewNetAppFilesSubvolume.cs +++ b/src/NetAppFiles/NetAppFiles/Subvolume/NewNetAppFilesSubvolume.cs @@ -141,7 +141,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, Name))) { - var anfSubvolume = AzureNetAppFilesManagementClient.Subvolumes.Create(subvolumeInfoBody, ResourceGroupName, AccountName, poolName: PoolName, volumeName: VolumeName, subvolumeName: Name); + var anfSubvolume = AzureNetAppFilesManagementClient.Subvolumes.Create(ResourceGroupName, AccountName, poolName: PoolName, volumeName: VolumeName, subvolumeName: Name, subvolumeInfoBody); WriteObject(anfSubvolume.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/Subvolume/UpdateNetAppFilesSubvolume.cs b/src/NetAppFiles/NetAppFiles/Subvolume/UpdateNetAppFilesSubvolume.cs index 98ff4aa7d38e..43f9129c171b 100644 --- a/src/NetAppFiles/NetAppFiles/Subvolume/UpdateNetAppFilesSubvolume.cs +++ b/src/NetAppFiles/NetAppFiles/Subvolume/UpdateNetAppFilesSubvolume.cs @@ -162,7 +162,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, Name))) { - var anfSubvolume = AzureNetAppFilesManagementClient.Subvolumes.Update(subvolumePatch, ResourceGroupName, accountName: AccountName, poolName: PoolName, volumeName: VolumeName, subvolumeName: Name); + var anfSubvolume = AzureNetAppFilesManagementClient.Subvolumes.Update(ResourceGroupName, accountName: AccountName, poolName: PoolName, volumeName: VolumeName, subvolumeName: Name, subvolumePatch); WriteObject(anfSubvolume.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/Volume/GetGroupIdListForLDAPUser.cs b/src/NetAppFiles/NetAppFiles/Volume/GetGroupIdListForLDAPUser.cs index 6b1fe5242122..2215535ba6d3 100644 --- a/src/NetAppFiles/NetAppFiles/Volume/GetGroupIdListForLDAPUser.cs +++ b/src/NetAppFiles/NetAppFiles/Volume/GetGroupIdListForLDAPUser.cs @@ -150,10 +150,10 @@ public override void ExecuteCmdlet() } if (Name != null) { - GetGroupIdListForLDAPUserRequest body = new GetGroupIdListForLDAPUserRequest(username: Username); + GetGroupIdListForLdapUserRequest body = new GetGroupIdListForLdapUserRequest(username: Username); try { - GetGroupIdListForLDAPUserResponse anfGroupIdList = AzureNetAppFilesManagementClient.Volumes.ListGetGroupIdListForLdapUser(ResourceGroupName, AccountName, PoolName, Name, body); + GetGroupIdListForLdapUserResponse anfGroupIdList = AzureNetAppFilesManagementClient.Volumes.ListGetGroupIdListForLdapUser(ResourceGroupName, AccountName, PoolName, Name, body); WriteObject(anfGroupIdList.ConvertToPs()); } catch (ErrorResponseException erx) diff --git a/src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs b/src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs index 8a20cb8abaca..f919b3631316 100644 --- a/src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs +++ b/src/NetAppFiles/NetAppFiles/Volume/NewNetAppFilesVolume.cs @@ -414,7 +414,7 @@ public override void ExecuteCmdlet() } if (ShouldProcess(PoolName, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, Name))) { - var anfVolume = AzureNetAppFilesManagementClient.Volumes.CreateOrUpdate(volumeBody, ResourceGroupName, AccountName, PoolName, Name); + var anfVolume = AzureNetAppFilesManagementClient.Volumes.CreateOrUpdate(ResourceGroupName, AccountName, PoolName, Name, volumeBody); WriteObject(anfVolume.ToPsNetAppFilesVolume()); } } diff --git a/src/NetAppFiles/NetAppFiles/Volume/UnlockNetAppFilesVolumeFileLock.cs b/src/NetAppFiles/NetAppFiles/Volume/UnlockNetAppFilesVolumeFileLock.cs index c04fda6bcf46..553db0d5c5ef 100644 --- a/src/NetAppFiles/NetAppFiles/Volume/UnlockNetAppFilesVolumeFileLock.cs +++ b/src/NetAppFiles/NetAppFiles/Volume/UnlockNetAppFilesVolumeFileLock.cs @@ -150,7 +150,7 @@ public override void ExecuteCmdlet() BreakFileLocksRequest _breakFileLockBody = null; if (string.IsNullOrWhiteSpace(ClientIp)) { - _breakFileLockBody = new BreakFileLocksRequest() { ClientIp = ClientIp, ConfirmRunningDisruptiveOperation = true }; + _breakFileLockBody = new BreakFileLocksRequest() { ClientIP = ClientIp, ConfirmRunningDisruptiveOperation = true }; } AzureNetAppFilesManagementClient.Volumes.BreakFileLocks(ResourceGroupName, AccountName, PoolName, Name, body: _breakFileLockBody); success = true; diff --git a/src/NetAppFiles/NetAppFiles/Volume/UpdateNetAppFilesVolume.cs b/src/NetAppFiles/NetAppFiles/Volume/UpdateNetAppFilesVolume.cs index 79ac9756b8e3..cc07f3f22d2b 100644 --- a/src/NetAppFiles/NetAppFiles/Volume/UpdateNetAppFilesVolume.cs +++ b/src/NetAppFiles/NetAppFiles/Volume/UpdateNetAppFilesVolume.cs @@ -259,7 +259,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.UpdateResourceMessage, ResourceGroupName))) { - var anfVolume = AzureNetAppFilesManagementClient.Volumes.Update(volumePatchBody, ResourceGroupName, AccountName, PoolName, Name); + var anfVolume = AzureNetAppFilesManagementClient.Volumes.Update(ResourceGroupName, AccountName, PoolName, Name, volumePatchBody); WriteObject(anfVolume.ToPsNetAppFilesVolume()); } } diff --git a/src/NetAppFiles/NetAppFiles/VolumeGroup/NewNetAppFilesVolumeGroup.cs b/src/NetAppFiles/NetAppFiles/VolumeGroup/NewNetAppFilesVolumeGroup.cs index 45d44ae3a8ae..08ad765c801e 100644 --- a/src/NetAppFiles/NetAppFiles/VolumeGroup/NewNetAppFilesVolumeGroup.cs +++ b/src/NetAppFiles/NetAppFiles/VolumeGroup/NewNetAppFilesVolumeGroup.cs @@ -353,7 +353,7 @@ public override void ExecuteCmdlet() var volumeGroup = CreateVolumeGroup(Name, ResourceGroupName, AccountName, poolResourceId, tagPairs); if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, ResourceGroupName))) { - var anfVolumeGroups = AzureNetAppFilesManagementClient.VolumeGroups.Create(volumeGroup, ResourceGroupName, AccountName, Name); + var anfVolumeGroups = AzureNetAppFilesManagementClient.VolumeGroups.Create(ResourceGroupName, AccountName, Name, volumeGroup); var ret = anfVolumeGroups.ConvertToPs(); WriteObject(ret); } @@ -371,8 +371,8 @@ private VolumeGroupDetails CreateVolumeGroup(string name, string reourceGroup, s Rules = new List() { new ExportPolicyRule { Nfsv3 = false, Nfsv41 = true, RuleIndex = 1, AllowedClients = "0.0.0.0/0", UnixReadOnly = false, UnixReadWrite = true, - Kerberos5ReadOnly = false, Kerberos5iReadOnly = false, Kerberos5iReadWrite = false, Kerberos5pReadOnly = false, - Kerberos5pReadWrite = false, Kerberos5ReadWrite = false + Kerberos5ReadOnly = false, Kerberos5IReadOnly = false, Kerberos5IReadWrite = false, Kerberos5PReadOnly = false, + Kerberos5PReadWrite = false, Kerberos5ReadWrite = false } } }; diff --git a/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/NewNetAppFilesVolumeQuotaRule.cs b/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/NewNetAppFilesVolumeQuotaRule.cs index afec6e380bda..f91ddc0a037c 100644 --- a/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/NewNetAppFilesVolumeQuotaRule.cs +++ b/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/NewNetAppFilesVolumeQuotaRule.cs @@ -163,7 +163,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, Name))) { - var anfVolumeQuotaRule = AzureNetAppFilesManagementClient.VolumeQuotaRules.Create(volumeQuotaRuleBody, ResourceGroupName, AccountName, poolName: PoolName, volumeName: VolumeName, volumeQuotaRuleName: Name); + var anfVolumeQuotaRule = AzureNetAppFilesManagementClient.VolumeQuotaRules.Create( ResourceGroupName, AccountName, poolName: PoolName, volumeName: VolumeName, volumeQuotaRuleName: Name, volumeQuotaRuleBody); WriteObject(anfVolumeQuotaRule.ConvertToPs()); } } diff --git a/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/UpdateNetAppFilesVolumeQuotaRule.cs b/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/UpdateNetAppFilesVolumeQuotaRule.cs index 625678c5847e..95d68c9fae7f 100644 --- a/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/UpdateNetAppFilesVolumeQuotaRule.cs +++ b/src/NetAppFiles/NetAppFiles/VolumeQuotaRules/UpdateNetAppFilesVolumeQuotaRule.cs @@ -190,7 +190,7 @@ public override void ExecuteCmdlet() if (ShouldProcess(Name, string.Format(PowerShell.Cmdlets.NetAppFiles.Properties.Resources.CreateResourceMessage, Name))) { - var anfVolumeQuotaRule = AzureNetAppFilesManagementClient.VolumeQuotaRules.Update(volumeQuotaRulePatchBody, ResourceGroupName, AccountName, poolName: PoolName, volumeName: VolumeName, volumeQuotaRuleName: Name); + var anfVolumeQuotaRule = AzureNetAppFilesManagementClient.VolumeQuotaRules.Update( ResourceGroupName, AccountName, poolName: PoolName, volumeName: VolumeName, volumeQuotaRuleName: Name, volumeQuotaRulePatchBody); WriteObject(anfVolumeQuotaRule.ConvertToPs()); } } diff --git a/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 b/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 index 4314ed055cef..884e4a214ba4 100644 --- a/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 +++ b/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 @@ -29,7 +29,7 @@ Class GeneratedSdkIssue { $ExceptionList = @() $SavePath = $PWD -$skipModules = @('Az.KeyVault', 'Az.CosmosDB', 'Az.AlertsManagement', 'Az.Automation') +$skipModules = @('Az.KeyVault', 'Az.CosmosDB', 'Az.AlertsManagement', 'Az.Automation', 'Az.NetAppFiles') $MissReadMe = 9000 $GenSdkChanged = 9090