diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs
new file mode 100644
index 000000000000..4de7ca92a6ad
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs
@@ -0,0 +1,721 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 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
+ {
+ ///
+ /// Initializes a new instance of the AccountBackupsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the AzureNetAppFilesManagementClient
+ ///
+ public AzureNetAppFilesManagementClient 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 of the NetApp account
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The 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))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("backupName", backupName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs
new file mode 100644
index 000000000000..21f4f96ea810
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs
@@ -0,0 +1,221 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NetApp
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// 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 of the NetApp account
+ ///
+ public static BackupsList 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 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
+ ///
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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();
+ }
+
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ public static void Delete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
+ {
+ operations.DeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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();
+ }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs
index e27d3b99c193..1798c24f3a0e 100644
--- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs
@@ -106,6 +106,31 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient
public virtual ISnapshotsOperations Snapshots { get; private set; }
+ ///
+ /// Gets the ISnapshotPoliciesOperations.
+ ///
+ public virtual ISnapshotPoliciesOperations SnapshotPolicies { get; private set; }
+
+ ///
+ /// Gets the IAccountBackupsOperations.
+ ///
+ public virtual IAccountBackupsOperations AccountBackups { get; private set; }
+
+ ///
+ /// Gets the IBackupsOperations.
+ ///
+ public virtual IBackupsOperations Backups { get; private set; }
+
+ ///
+ /// Gets the IBackupPoliciesOperations.
+ ///
+ public virtual IBackupPoliciesOperations BackupPolicies { get; private set; }
+
+ ///
+ /// Gets the IVaultsOperations.
+ ///
+ public virtual IVaultsOperations Vaults { get; private set; }
+
///
/// Initializes a new instance of the AzureNetAppFilesManagementClient class.
///
@@ -353,8 +378,13 @@ private void Initialize()
Pools = new PoolsOperations(this);
Volumes = new VolumesOperations(this);
Snapshots = new SnapshotsOperations(this);
+ SnapshotPolicies = new SnapshotPoliciesOperations(this);
+ AccountBackups = new AccountBackupsOperations(this);
+ Backups = new BackupsOperations(this);
+ BackupPolicies = new BackupPoliciesOperations(this);
+ Vaults = new VaultsOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2020-02-01";
+ ApiVersion = "2020-06-01";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs
new file mode 100644
index 000000000000..839fdc0a8bf4
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs
@@ -0,0 +1,1248 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 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
+ {
+ ///
+ /// Initializes a new instance of the BackupPoliciesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the AzureNetAppFilesManagementClient
+ ///
+ public AzureNetAppFilesManagementClient Client { get; private set; }
+
+ ///
+ /// List backup policies
+ ///
+ ///
+ /// List backup policies for Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a backup Policy
+ ///
+ ///
+ /// Get a particular backup Policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (backupPolicyName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("backupPolicyName", backupPolicyName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create a backup policy
+ ///
+ ///
+ /// Create a backup policy for Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 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))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await 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 of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// Backup 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (backupPolicyName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (body == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(body != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete a backup policy
+ ///
+ ///
+ /// Delete backup policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// The 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))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await 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 of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// Backup 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// 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))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (backupPolicyName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (body == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ }
+ if (body != null)
+ {
+ body.Validate();
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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);
+ }
+ // Construct URL
+ var _baseUrl = 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("{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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(body != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete a backup policy
+ ///
+ ///
+ /// Delete backup policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (backupPolicyName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupPolicyName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("backupPolicyName", backupPolicyName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs
new file mode 100644
index 000000000000..1b44800f0631
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs
@@ -0,0 +1,397 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 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.
+ ///
+ 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 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 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 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 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 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();
+ }
+
+ ///
+ /// 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 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))
+ {
+ using (var _result = await operations.CreateWithHttpMessagesAsync(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 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)
+ {
+ return operations.UpdateAsync(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 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))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete a backup policy
+ ///
+ ///
+ /// Delete backup policy
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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)
+ {
+ 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 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 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 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;
+ }
+ }
+
+ ///
+ /// Delete a backup policy
+ ///
+ ///
+ /// Delete backup policy
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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)
+ {
+ operations.BeginDeleteAsync(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 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))
+ {
+ (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs
new file mode 100644
index 000000000000..bc48acba6a9b
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs
@@ -0,0 +1,1496 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 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
+ {
+ ///
+ /// Initializes a new instance of the BackupsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BackupsOperations(AzureNetAppFilesManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the AzureNetAppFilesManagementClient
+ ///
+ public AzureNetAppFilesManagementClient Client { get; private set; }
+
+ ///
+ /// List Backups
+ ///
+ ///
+ /// List all backups for a volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (poolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "poolName");
+ }
+ if (poolName != null)
+ {
+ if (poolName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "poolName", 64);
+ }
+ if (poolName.Length < 1)
+ {
+ throw new ValidationException(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}$");
+ }
+ }
+ if (volumeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "volumeName");
+ }
+ if (volumeName != null)
+ {
+ if (volumeName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64);
+ }
+ if (volumeName.Length < 1)
+ {
+ throw new ValidationException(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");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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);
+ }
+ // Construct URL
+ var _baseUrl = 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("{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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a backup
+ ///
+ ///
+ /// Get a particular backup of the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (poolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "poolName");
+ }
+ if (poolName != null)
+ {
+ if (poolName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "poolName", 64);
+ }
+ if (poolName.Length < 1)
+ {
+ throw new ValidationException(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}$");
+ }
+ }
+ if (volumeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "volumeName");
+ }
+ if (volumeName != null)
+ {
+ if (volumeName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64);
+ }
+ if (volumeName.Length < 1)
+ {
+ throw new ValidationException(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 (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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);
+ }
+ // Construct URL
+ var _baseUrl = 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("{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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create a backup
+ ///
+ ///
+ /// Create a backup for the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 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))
+ {
+ // 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);
+ }
+
+ ///
+ /// Patch a backup
+ ///
+ ///
+ /// Patch a backup for the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (poolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "poolName");
+ }
+ if (poolName != null)
+ {
+ if (poolName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "poolName", 64);
+ }
+ if (poolName.Length < 1)
+ {
+ throw new ValidationException(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}$");
+ }
+ }
+ if (volumeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "volumeName");
+ }
+ if (volumeName != null)
+ {
+ if (volumeName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64);
+ }
+ if (volumeName.Length < 1)
+ {
+ throw new ValidationException(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 (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(body != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete backup
+ ///
+ ///
+ /// Delete a backup of the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The 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))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, backupName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Create a backup
+ ///
+ ///
+ /// Create a backup for the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (poolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "poolName");
+ }
+ if (poolName != null)
+ {
+ if (poolName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "poolName", 64);
+ }
+ if (poolName.Length < 1)
+ {
+ throw new ValidationException(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}$");
+ }
+ }
+ if (volumeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "volumeName");
+ }
+ if (volumeName != null)
+ {
+ if (volumeName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64);
+ }
+ if (volumeName.Length < 1)
+ {
+ throw new ValidationException(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 (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (body == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ }
+ if (body != null)
+ {
+ body.Validate();
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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);
+ }
+ // Construct URL
+ var _baseUrl = 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("{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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(body != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete backup
+ ///
+ ///
+ /// Delete a backup of the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (accountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ }
+ if (poolName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "poolName");
+ }
+ if (poolName != null)
+ {
+ if (poolName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "poolName", 64);
+ }
+ if (poolName.Length < 1)
+ {
+ throw new ValidationException(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}$");
+ }
+ }
+ if (volumeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "volumeName");
+ }
+ if (volumeName != null)
+ {
+ if (volumeName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64);
+ }
+ if (volumeName.Length < 1)
+ {
+ throw new ValidationException(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 (backupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new 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);
+ }
+ // Construct URL
+ var _baseUrl = 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("{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)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs
new file mode 100644
index 000000000000..8a6f5e2f6c3e
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs
@@ -0,0 +1,481 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 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.
+ ///
+ public static partial class BackupsOperationsExtensions
+ {
+ ///
+ /// List Backups
+ ///
+ ///
+ /// List all backups for a volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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)
+ {
+ return operations.ListAsync(resourceGroupName, accountName, poolName, volumeName).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 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))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get a backup
+ ///
+ ///
+ /// Get a particular backup of the volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, backupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a backup
+ ///
+ ///
+ /// Get a particular backup of the volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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;
+ }
+ }
+
+ ///
+ /// Create a backup
+ ///
+ ///
+ /// Create a backup for the volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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)
+ {
+ return operations.CreateAsync(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 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))
+ {
+ using (var _result = await operations.CreateWithHttpMessagesAsync(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 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))
+ {
+ return operations.UpdateAsync(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 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 backup
+ ///
+ ///
+ /// Delete a backup of the volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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)
+ {
+ operations.DeleteAsync(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 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 backup
+ ///
+ ///
+ /// Create a backup for the volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 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;
+ }
+ }
+
+ ///
+ /// Delete backup
+ ///
+ ///
+ /// Delete a backup of the volume
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 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();
+ }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs
new file mode 100644
index 000000000000..e0cd67339e77
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs
@@ -0,0 +1,142 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// AccountBackupsOperations operations.
+ ///
+ public partial interface IAccountBackupsOperations
+ {
+ ///
+ /// List Backups for a Netapp Account
+ ///
+ ///
+ /// List all Backups for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// Get Backup for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// Delete Backup for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs
index 38bd56ef93fe..fb0b3569c199 100644
--- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs
@@ -101,5 +101,30 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable
///
ISnapshotsOperations Snapshots { get; }
+ ///
+ /// Gets the ISnapshotPoliciesOperations.
+ ///
+ ISnapshotPoliciesOperations SnapshotPolicies { get; }
+
+ ///
+ /// Gets the IAccountBackupsOperations.
+ ///
+ IAccountBackupsOperations AccountBackups { get; }
+
+ ///
+ /// Gets the IBackupsOperations.
+ ///
+ IBackupsOperations Backups { get; }
+
+ ///
+ /// Gets the IBackupPoliciesOperations.
+ ///
+ IBackupPoliciesOperations BackupPolicies { get; }
+
+ ///
+ /// Gets the IVaultsOperations.
+ ///
+ IVaultsOperations Vaults { get; }
+
}
}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs
new file mode 100644
index 000000000000..d299f191a28b
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs
@@ -0,0 +1,244 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.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.
+ ///
+ public partial interface IBackupPoliciesOperations
+ {
+ ///
+ /// List backup policies
+ ///
+ ///
+ /// List backup policies for Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a backup Policy
+ ///
+ ///
+ /// Get a particular backup Policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a backup policy
+ ///
+ ///
+ /// Create a backup policy for Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation 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> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Patch a backup policy
+ ///
+ ///
+ /// Patch a backup policy for Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete a backup policy
+ ///
+ ///
+ /// Delete backup policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a backup policy
+ ///
+ ///
+ /// Create a backup policy for Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation 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> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete a backup policy
+ ///
+ ///
+ /// Delete backup policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// Backup policy Name which uniquely identify backup policy.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs
new file mode 100644
index 000000000000..dc424cb05c15
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs
@@ -0,0 +1,286 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// BackupsOperations operations.
+ ///
+ public partial interface IBackupsOperations
+ {
+ ///
+ /// List Backups
+ ///
+ ///
+ /// List all backups for a volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a backup
+ ///
+ ///
+ /// Get a particular backup of the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a backup
+ ///
+ ///
+ /// Create a backup for the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation 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> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Patch a backup
+ ///
+ ///
+ /// Patch a backup for the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, BackupPatch body = default(BackupPatch), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete backup
+ ///
+ ///
+ /// Delete a backup of the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a backup
+ ///
+ ///
+ /// Create a backup for the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation 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> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Backup body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete backup
+ ///
+ ///
+ /// Delete a backup of the volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs
index 687180f023c8..bcfe391b6a98 100644
--- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs
@@ -60,7 +60,7 @@ public partial interface INetAppResourceOperations
///
/// Thrown when a required parameter is null
///
- Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CheckNameAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Check file path availability
///
@@ -98,6 +98,44 @@ public partial interface INetAppResourceOperations
///
/// Thrown when a required parameter is null
///
- Task> CheckFilePathAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CheckFilePathAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Check quota availability
+ ///
+ ///
+ /// Check if a quota is available.
+ ///
+ ///
+ /// The location
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation 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> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs
new file mode 100644
index 000000000000..63cc2a0983c5
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs
@@ -0,0 +1,223 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// SnapshotPoliciesOperations operations.
+ ///
+ public partial interface ISnapshotPoliciesOperations
+ {
+ ///
+ /// List snapshot policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a snapshot Policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the snapshot policy target
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a snapshot policy
+ ///
+ ///
+ /// Snapshot policy object supplied in the body of the operation.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the snapshot policy target
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateWithHttpMessagesAsync(SnapshotPolicy body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Patch a snapshot policy
+ ///
+ ///
+ /// Snapshot policy object supplied in the body of the operation.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the snapshot policy target
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(SnapshotPolicyPatch body, string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete snapshot policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the snapshot policy target
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get volumes associated with snapshot policy
+ ///
+ ///
+ /// Get volumes associated with snapshot policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the snapshot policy target
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> ListVolumesWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete snapshot policy
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the snapshot policy target
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVaultsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVaultsOperations.cs
new file mode 100644
index 000000000000..53053a90ff48
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVaultsOperations.cs
@@ -0,0 +1,55 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NetApp
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// VaultsOperations operations.
+ ///
+ public partial interface IVaultsOperations
+ {
+ ///
+ /// List vaults
+ ///
+ ///
+ /// List vaults for a Netapp Account
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs
index e87e705bb053..ecceebb84c5a 100644
--- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs
@@ -246,6 +246,9 @@ public partial interface IVolumesOperations
///
/// The name of the volume
///
+ ///
+ /// Optional body to force break the replication.
+ ///
///
/// The headers that will be added to request.
///
@@ -258,7 +261,7 @@ public partial interface IVolumesOperations
///
/// Thrown when a required parameter is null
///
- Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get volume replication status
///
@@ -393,6 +396,71 @@ public partial interface IVolumesOperations
///
Task AuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// ReInitialize volume replication
+ ///
+ ///
+ /// Re-Initializes the replication connection on the destination volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task ReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Change pool for volume
+ ///
+ ///
+ /// Moves volume to another pool
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task PoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Create or Update a volume
///
///
@@ -550,6 +618,9 @@ public partial interface IVolumesOperations
///
/// The name of the volume
///
+ ///
+ /// Optional body to force break the replication.
+ ///
///
/// The headers that will be added to request.
///
@@ -562,7 +633,7 @@ public partial interface IVolumesOperations
///
/// Thrown when a required parameter is null
///
- Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Resync volume replication
///
@@ -662,5 +733,70 @@ public partial interface IVolumesOperations
/// 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));
+ ///
+ /// ReInitialize volume replication
+ ///
+ ///
+ /// Re-Initializes the replication connection on the destination volume
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the capacity pool
+ ///
+ ///
+ /// The name of the volume
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Change pool for volume
+ ///
+ ///
+ /// Moves volume to another pool
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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 headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs
index 4306f0bb27f0..573ef294a4ad 100644
--- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs
@@ -10,6 +10,7 @@
namespace Microsoft.Azure.Management.NetApp.Models
{
+ using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
@@ -35,11 +36,15 @@ public ActiveDirectory()
/// Username of Active Directory domain
/// administrator
/// Plain text password of Active Directory
- /// domain administrator
+ /// 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
+ /// 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
@@ -50,7 +55,18 @@ public ActiveDirectory()
/// Users to be added to the Built-in
/// Backup Operator active directory group. A list of unique usernames
/// without domain specifier
- 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 smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), IList backupOperators = default(IList))
+ /// 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.
+ 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), string kdcIP = default(string), string adName = default(string), string serverRootCACertificate = default(string))
{
ActiveDirectoryId = activeDirectoryId;
Username = username;
@@ -58,10 +74,14 @@ public ActiveDirectory()
Domain = domain;
Dns = dns;
Status = status;
+ StatusDetails = statusDetails;
SmbServerName = smbServerName;
OrganizationalUnit = organizationalUnit;
Site = site;
BackupOperators = backupOperators;
+ KdcIP = kdcIP;
+ AdName = adName;
+ ServerRootCACertificate = serverRootCACertificate;
CustomInit();
}
@@ -84,7 +104,7 @@ public ActiveDirectory()
///
/// Gets or sets plain text password of Active Directory domain
- /// administrator
+ /// administrator, value is masked in the response
///
[JsonProperty(PropertyName = "password")]
public string Password { get; set; }
@@ -103,10 +123,17 @@ public ActiveDirectory()
public string Dns { get; set; }
///
- /// Gets or sets status of the Active Directory
+ /// Gets status of the Active Directory. Possible values include:
+ /// 'Created', 'InUse', 'Deleted', 'Error', 'Updating'
///
[JsonProperty(PropertyName = "status")]
- public string Status { get; set; }
+ 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; }
///
/// Gets or sets netBIOS name of the SMB server. This name will be
@@ -138,5 +165,74 @@ public ActiveDirectory()
[JsonProperty(PropertyName = "backupOperators")]
public IList BackupOperators { get; set; }
+ ///
+ /// 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; }
+
+ ///
+ /// 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; }
+
+ ///
+ /// 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; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (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]?))*$"))
+ {
+ 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]?))*$");
+ }
+ }
+ if (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]?))*$"))
+ {
+ 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]?))*$");
+ }
+ }
+ if (AdName != null)
+ {
+ if (AdName.Length > 64)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "AdName", 64);
+ }
+ if (AdName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "AdName", 1);
+ }
+ }
+ if (ServerRootCACertificate != null)
+ {
+ if (ServerRootCACertificate.Length > 10240)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "ServerRootCACertificate", 10240);
+ }
+ if (ServerRootCACertificate.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "ServerRootCACertificate", 1);
+ }
+ }
+ }
}
}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectoryStatus.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectoryStatus.cs
new file mode 100644
index 000000000000..b02b3b60ac8b
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectoryStatus.cs
@@ -0,0 +1,40 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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
+{
+
+ ///
+ /// Defines values for ActiveDirectoryStatus.
+ ///
+ public static class ActiveDirectoryStatus
+ {
+ ///
+ /// Active Directory created but not in use
+ ///
+ public const string Created = "Created";
+ ///
+ /// Active Directory in use by SMB Volume
+ ///
+ public const string InUse = "InUse";
+ ///
+ /// Active Directory Deleted
+ ///
+ public const string Deleted = "Deleted";
+ ///
+ /// Error with the Active Directory
+ ///
+ public const string Error = "Error";
+ ///
+ /// Active Directory Updating
+ ///
+ public const string Updating = "Updating";
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs
new file mode 100644
index 000000000000..f2ae5a9017d8
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs
@@ -0,0 +1,135 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NetApp.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Backup of a Volume
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class Backup : IResource
+ {
+ ///
+ /// Initializes a new instance of the Backup class.
+ ///
+ public Backup()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Backup class.
+ ///
+ /// Resource location
+ /// Resource Id
+ /// Resource name
+ /// Resource type
+ /// name
+ /// Azure lifecycle management
+ /// Size of backup
+ /// Label for backup
+ /// Type of backup adhoc or scheduled
+ public Backup(string location, string id = default(string), string name = default(string), string type = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string))
+ {
+ Location = location;
+ Id = id;
+ Name = name;
+ Type = type;
+ CreationDate = creationDate;
+ ProvisioningState = provisioningState;
+ Size = size;
+ Label = label;
+ BackupType = backupType;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource location
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ ///
+ /// Gets resource Id
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets resource name
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets name
+ ///
+ ///
+ /// The creation date of the backup
+ ///
+ [JsonProperty(PropertyName = "properties.creationDate")]
+ public System.DateTime? CreationDate { get; private set; }
+
+ ///
+ /// Gets azure lifecycle management
+ ///
+ [JsonProperty(PropertyName = "properties.provisioningState")]
+ public string ProvisioningState { get; private set; }
+
+ ///
+ /// Gets size of backup
+ ///
+ [JsonProperty(PropertyName = "properties.size")]
+ public long? Size { get; private set; }
+
+ ///
+ /// Gets or sets label for backup
+ ///
+ [JsonProperty(PropertyName = "properties.label")]
+ public string Label { get; set; }
+
+ ///
+ /// Gets type of backup adhoc or scheduled
+ ///
+ [JsonProperty(PropertyName = "properties.backupType")]
+ public string BackupType { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Location");
+ }
+ }
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs
new file mode 100644
index 000000000000..c494743b21a0
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs
@@ -0,0 +1,100 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.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 patch
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class BackupPatch : IResource
+ {
+ ///
+ /// Initializes a new instance of the BackupPatch class.
+ ///
+ public BackupPatch()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupPatch class.
+ ///
+ /// Resource tags
+ /// name
+ /// Azure lifecycle management
+ /// Size of backup
+ /// Label for backup
+ /// Type of backup adhoc or scheduled
+ public BackupPatch(IDictionary tags = default(IDictionary), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string))
+ {
+ Tags = tags;
+ CreationDate = creationDate;
+ ProvisioningState = provisioningState;
+ Size = size;
+ Label = label;
+ BackupType = backupType;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets name
+ ///
+ ///
+ /// The creation date of the backup
+ ///
+ [JsonProperty(PropertyName = "properties.creationDate")]
+ public System.DateTime? CreationDate { get; private set; }
+
+ ///
+ /// Gets azure lifecycle management
+ ///
+ [JsonProperty(PropertyName = "properties.provisioningState")]
+ public string ProvisioningState { get; private set; }
+
+ ///
+ /// Gets size of backup
+ ///
+ [JsonProperty(PropertyName = "properties.size")]
+ public long? Size { get; private set; }
+
+ ///
+ /// Gets or sets label for backup
+ ///
+ [JsonProperty(PropertyName = "properties.label")]
+ public string Label { get; set; }
+
+ ///
+ /// Gets type of backup adhoc or scheduled
+ ///
+ [JsonProperty(PropertyName = "properties.backupType")]
+ public string BackupType { get; private set; }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs
new file mode 100644
index 000000000000..e639960b9b65
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs
@@ -0,0 +1,181 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.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 information
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class BackupPolicy : IResource
+ {
+ ///
+ /// Initializes a new instance of the BackupPolicy class.
+ ///
+ public BackupPolicy()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupPolicy class.
+ ///
+ /// Resource location
+ /// Resource Id
+ /// Resource name
+ /// Resource type
+ /// Resource tags
+ /// Name of backup policy
+ /// Azure lifecycle management
+ /// Daily backups count to
+ /// keep
+ /// Weekly backups count to
+ /// keep
+ /// Monthly backups count to
+ /// keep
+ /// Yearly 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), IDictionary tags = default(IDictionary), string name1 = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? yearlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList))
+ {
+ Location = location;
+ Id = id;
+ Name = name;
+ Type = type;
+ Tags = tags;
+ Name1 = name1;
+ ProvisioningState = provisioningState;
+ DailyBackupsToKeep = dailyBackupsToKeep;
+ WeeklyBackupsToKeep = weeklyBackupsToKeep;
+ MonthlyBackupsToKeep = monthlyBackupsToKeep;
+ YearlyBackupsToKeep = yearlyBackupsToKeep;
+ VolumesAssigned = volumesAssigned;
+ Enabled = enabled;
+ VolumeBackups = volumeBackups;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource location
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ ///
+ /// Gets resource Id
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets resource name
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets name of backup policy
+ ///
+ [JsonProperty(PropertyName = "properties.name")]
+ public string Name1 { get; private set; }
+
+ ///
+ /// Gets azure lifecycle management
+ ///
+ [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; }
+
+ ///
+ /// Gets or sets weekly backups count to keep
+ ///
+ [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; }
+
+ ///
+ /// Gets or sets yearly backups count to keep
+ ///
+ [JsonProperty(PropertyName = "properties.yearlyBackupsToKeep")]
+ public int? YearlyBackupsToKeep { get; set; }
+
+ ///
+ /// Gets or sets volumes using current backup policy
+ ///
+ [JsonProperty(PropertyName = "properties.volumesAssigned")]
+ public int? VolumesAssigned { get; set; }
+
+ ///
+ /// Gets or sets the property to decide policy is enabled or not
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool? Enabled { get; set; }
+
+ ///
+ /// Gets or sets a list of volumes assigned to this policy
+ ///
+ [JsonProperty(PropertyName = "properties.volumeBackups")]
+ public IList VolumeBackups { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Location");
+ }
+ }
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs
new file mode 100644
index 000000000000..5cb32aaf56b3
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs
@@ -0,0 +1,168 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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 Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Backup policy properties
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class BackupPolicyDetails : IResource
+ {
+ ///
+ /// Initializes a new instance of the BackupPolicyDetails class.
+ ///
+ public BackupPolicyDetails()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupPolicyDetails class.
+ ///
+ /// Resource location
+ /// Resource Id
+ /// Resource name
+ /// Resource type
+ /// Resource tags
+ /// Name of backup policy
+ /// Azure lifecycle management
+ /// Daily backups count to
+ /// keep
+ /// Weekly backups count to
+ /// keep
+ /// Monthly backups count to
+ /// keep
+ /// Yearly 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 BackupPolicyDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string name1 = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? yearlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList))
+ {
+ Location = location;
+ Id = id;
+ Name = name;
+ Type = type;
+ Tags = tags;
+ Name1 = name1;
+ ProvisioningState = provisioningState;
+ DailyBackupsToKeep = dailyBackupsToKeep;
+ WeeklyBackupsToKeep = weeklyBackupsToKeep;
+ MonthlyBackupsToKeep = monthlyBackupsToKeep;
+ YearlyBackupsToKeep = yearlyBackupsToKeep;
+ VolumesAssigned = volumesAssigned;
+ Enabled = enabled;
+ VolumeBackups = volumeBackups;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource location
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ ///
+ /// Gets resource Id
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets resource name
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets name of backup policy
+ ///
+ [JsonProperty(PropertyName = "properties.name")]
+ public string Name1 { get; private set; }
+
+ ///
+ /// Gets azure lifecycle management
+ ///
+ [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; }
+
+ ///
+ /// Gets or sets weekly backups count to keep
+ ///
+ [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; }
+
+ ///
+ /// Gets or sets yearly backups count to keep
+ ///
+ [JsonProperty(PropertyName = "properties.yearlyBackupsToKeep")]
+ public int? YearlyBackupsToKeep { get; set; }
+
+ ///
+ /// Gets or sets volumes using current backup policy
+ ///
+ [JsonProperty(PropertyName = "properties.volumesAssigned")]
+ public int? VolumesAssigned { get; set; }
+
+ ///
+ /// Gets or sets the property to decide policy is enabled or not
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool? Enabled { get; set; }
+
+ ///
+ /// Gets or sets a list of volumes assigned to this policy
+ ///
+ [JsonProperty(PropertyName = "properties.volumeBackups")]
+ public IList VolumeBackups { get; set; }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs
new file mode 100644
index 000000000000..6285b3d2dfe7
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs
@@ -0,0 +1,135 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NetApp.Models
+{
+ using Microsoft.Rest;
+ 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
+ {
+ ///
+ /// Initializes a new instance of the BackupPolicyPatch class.
+ ///
+ public BackupPolicyPatch()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupPolicyPatch class.
+ ///
+ /// Resource location
+ /// Name of backup policy
+ /// Azure lifecycle management
+ /// Daily backups count to
+ /// keep
+ /// Weekly backups count to
+ /// keep
+ /// Monthly backups count to
+ /// keep
+ /// Yearly 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 name = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? yearlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList))
+ {
+ Location = location;
+ Name = name;
+ ProvisioningState = provisioningState;
+ DailyBackupsToKeep = dailyBackupsToKeep;
+ WeeklyBackupsToKeep = weeklyBackupsToKeep;
+ MonthlyBackupsToKeep = monthlyBackupsToKeep;
+ YearlyBackupsToKeep = yearlyBackupsToKeep;
+ VolumesAssigned = volumesAssigned;
+ Enabled = enabled;
+ VolumeBackups = volumeBackups;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource location
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ ///
+ /// Gets name of backup policy
+ ///
+ [JsonProperty(PropertyName = "properties.name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets azure lifecycle management
+ ///
+ [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; }
+
+ ///
+ /// Gets or sets weekly backups count to keep
+ ///
+ [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; }
+
+ ///
+ /// Gets or sets yearly backups count to keep
+ ///
+ [JsonProperty(PropertyName = "properties.yearlyBackupsToKeep")]
+ public int? YearlyBackupsToKeep { get; set; }
+
+ ///
+ /// Gets or sets volumes using current backup policy
+ ///
+ [JsonProperty(PropertyName = "properties.volumesAssigned")]
+ public int? VolumesAssigned { get; set; }
+
+ ///
+ /// Gets or sets the property to decide policy is enabled or not
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool? Enabled { get; set; }
+
+ ///
+ /// Gets or sets a list of volumes assigned to this policy
+ ///
+ [JsonProperty(PropertyName = "properties.volumeBackups")]
+ public IList VolumeBackups { get; set; }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupsList.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupsList.cs
new file mode 100644
index 000000000000..fa61eb952215
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupsList.cs
@@ -0,0 +1,53 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NetApp.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// List of Backups
+ ///
+ public partial class BackupsList
+ {
+ ///
+ /// Initializes a new instance of the BackupsList class.
+ ///
+ public BackupsList()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupsList class.
+ ///
+ /// A list of Backups
+ public BackupsList(IList value = default(IList))
+ {
+ Value = value;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets a list of Backups
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public IList Value { get; set; }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BreakReplicationRequest.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BreakReplicationRequest.cs
new file mode 100644
index 000000000000..7da271e0c069
--- /dev/null
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BreakReplicationRequest.cs
@@ -0,0 +1,54 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated 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;
+
+ ///
+ /// Break replication request
+ ///
+ public partial class BreakReplicationRequest
+ {
+ ///
+ /// Initializes a new instance of the BreakReplicationRequest class.
+ ///
+ public BreakReplicationRequest()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// 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
+ public BreakReplicationRequest(bool? forceBreakReplication = default(bool?))
+ {
+ ForceBreakReplication = forceBreakReplication;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// 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; }
+
+ }
+}
diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs
index 8e7a3fb88696..cebfa8fd9f97 100644
--- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs
+++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs
@@ -44,7 +44,12 @@ public CapacityPool()
/// Resource tags
/// poolId
/// Azure lifecycle management
- public CapacityPool(string location, long size, string serviceLevel, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary