diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs
index 4e78ee9be9b6..e1c099fe2018 100644
--- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs
+++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperations.cs
@@ -1,31 +1,19 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.NetApp
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Threading;
- using System.Threading.Tasks;
///
/// AccountBackupsOperations operations.
///
- internal partial class AccountBackupsOperations : IServiceOperations, IAccountBackupsOperations
+ internal partial class AccountBackupsOperations : Microsoft.Rest.IServiceOperations, IAccountBackupsOperations
{
///
/// Initializes a new instance of the AccountBackupsOperations class.
@@ -36,26 +24,23 @@ internal partial class AccountBackupsOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
+ internal AccountBackupsOperations (NetAppManagementClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
- /// Gets a reference to the AzureNetAppFilesManagementClient
+ /// Gets a reference to the NetAppManagementClient
///
- public AzureNetAppFilesManagementClient Client { get; private set; }
+ public NetAppManagementClient Client { get; private set; }
///
- /// List Backups for a Netapp Account
- ///
- ///
/// List all Backups for a Netapp Account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -68,13 +53,13 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -83,103 +68,104 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -191,55 +177,56 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -249,9 +236,10 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -262,31 +250,32 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Get Backup for a Netapp Account
- ///
- ///
/// Gets the specified backup for a Netapp Account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -302,13 +291,13 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -317,116 +306,117 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
if (backupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName");
}
if (backupName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion == null)
{
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
tracingParameters.Add("backupName", backupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
_url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -438,55 +428,56 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -496,9 +487,10 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -509,31 +501,32 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Delete Backup for a Netapp Account
- ///
- ///
/// Delete the specified Backup for a Netapp Account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -544,24 +537,21 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
/// The name of the backup
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Delete Backup for a Netapp Account
- ///
- ///
/// Delete the specified Backup for a Netapp Account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -577,10 +567,10 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -589,116 +579,117 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
if (backupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "backupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "backupName");
}
if (backupName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(backupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "backupName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
tracingParameters.Add("backupName", backupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
_url = _url.Replace("{backupName}", System.Uri.EscapeDataString(backupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -710,55 +701,56 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -768,19 +760,24 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs
index d4ab92c8cd9e..504c45c9137c 100644
--- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs
+++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountBackupsOperationsExtensions.cs
@@ -1,223 +1,184 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.NetApp
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for AccountBackupsOperations.
+ /// Extension methods for AccountBackupsOperations
///
public static partial class AccountBackupsOperationsExtensions
{
- ///
- /// List Backups for a Netapp Account
- ///
- ///
- /// List all Backups for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- public static IEnumerable List(this IAccountBackupsOperations operations, string resourceGroupName, string accountName)
- {
- return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
- }
-
- ///
- /// List Backups for a Netapp Account
- ///
- ///
- /// List all Backups for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Get Backup for a Netapp Account
- ///
- ///
- /// Gets the specified backup for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The name of the backup
- ///
- public static Backup Get(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
- {
- return operations.GetAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
- }
+ ///
+ /// List all Backups for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ public static System.Collections.Generic.IEnumerable List(this IAccountBackupsOperations operations, string resourceGroupName, string accountName)
+ {
+ return ((IAccountBackupsOperations)operations).ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
+ }
- ///
- /// Get Backup for a Netapp Account
- ///
- ///
- /// Gets the specified backup for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The name of the backup
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// List all Backups for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task> ListAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
+ }
+ ///
+ /// Gets the specified backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ public static Backup Get(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
+ {
+ return ((IAccountBackupsOperations)operations).GetAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
+ }
- ///
- /// Delete Backup for a Netapp Account
- ///
- ///
- /// Delete the specified Backup for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The name of the backup
- ///
- public static void Delete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
+ ///
+ /// Gets the specified backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false))
{
- operations.DeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
+ return _result.Body;
}
+ }
+ ///
+ /// Delete the specified Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ public static void Delete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
+ {
+ ((IAccountBackupsOperations)operations).DeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
+ }
- ///
- /// Delete Backup for a Netapp Account
- ///
- ///
- /// Delete the specified Backup for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The name of the backup
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task DeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
-
- ///
- /// Delete Backup for a Netapp Account
- ///
- ///
- /// Delete the specified Backup for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The name of the backup
- ///
- public static void BeginDelete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
- {
- operations.BeginDeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
- }
-
- ///
- /// Delete Backup for a Netapp Account
- ///
- ///
- /// Delete the specified Backup for a Netapp Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the resource group. The name is case insensitive.
- ///
- ///
- /// The name of the NetApp account
- ///
- ///
- /// The name of the backup
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task BeginDeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
+ ///
+ /// Delete the specified Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task DeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+ ///
+ /// Delete the specified Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ public static void BeginDelete(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName)
+ {
+ ((IAccountBackupsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, backupName).GetAwaiter().GetResult();
+ }
+ ///
+ /// Delete the specified Backup for a Netapp Account
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the NetApp account
+ ///
+ ///
+ /// The name of the backup
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task BeginDeleteAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, string backupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
}
}
diff --git a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs
index 2b98ead09fbe..fbab4418bf85 100644
--- a/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs
+++ b/src/NetAppFiles/NetAppFiles.Management.Sdk/Generated/AccountsOperations.cs
@@ -1,31 +1,19 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.NetApp
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Threading;
- using System.Threading.Tasks;
///
/// AccountsOperations operations.
///
- internal partial class AccountsOperations : IServiceOperations, IAccountsOperations
+ internal partial class AccountsOperations : Microsoft.Rest.IServiceOperations, IAccountsOperations
{
///
/// Initializes a new instance of the AccountsOperations class.
@@ -36,39 +24,36 @@ internal partial class AccountsOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal AccountsOperations(AzureNetAppFilesManagementClient client)
+ internal AccountsOperations (NetAppManagementClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
- /// Gets a reference to the AzureNetAppFilesManagementClient
+ /// Gets a reference to the NetAppManagementClient
///
- public AzureNetAppFilesManagementClient Client { get; private set; }
+ public NetAppManagementClient Client { get; private set; }
///
- /// Describe all NetApp Accounts in a subscription
- ///
- ///
/// List and describe all NetApp accounts in the subscription.
- ///
+ ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -77,73 +62,74 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
- if (Client.ApiVersion == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -155,55 +141,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -213,9 +200,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -226,31 +214,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Describe all NetApp Accounts in a resource group
- ///
- ///
/// List and describe all NetApp accounts in the resource group.
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -260,13 +249,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -275,90 +264,91 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion == null)
{
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -370,55 +360,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -428,9 +419,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -441,31 +433,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Describe a NetApp Account
- ///
- ///
/// Get the NetApp account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -478,13 +471,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -493,103 +486,104 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -601,55 +595,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -659,9 +654,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -672,59 +668,57 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Create or update a NetApp account
- ///
- ///
/// Create or update the specified NetApp account within the resource group
- ///
- ///
- /// NetApp Account object supplied in the body of the operation.
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
///
/// The name of the NetApp account
///
+ ///
+ /// NetApp Account object supplied in the body of the operation.
+ ///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(NetAppAccount body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccount body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Delete a NetApp account
- ///
- ///
/// Delete the specified NetApp account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -732,54 +726,46 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
/// The name of the NetApp account
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Update a NetApp account
- ///
- ///
/// Patch the specified NetApp account
- ///
- ///
- /// NetApp Account object supplied in the body of the operation.
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
///
/// The name of the NetApp account
///
+ ///
+ /// NetApp Account object supplied in the body of the operation.
+ ///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task> UpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccountPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send Request
- AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, body, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Renew identity credentials
+ /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
///
- ///
- /// Renew identity credentials that are used to authenticate to key vault, for
- /// customer-managed key encryption. If encryption.identity.principalId does
- /// not match identity.principalId, running this operation will fix it.
- ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -787,46 +773,43 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
/// The name of the NetApp account
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send request
- AzureOperationResponse _response = await BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Create or update a NetApp account
- ///
- ///
/// Create or update the specified NetApp account within the resource group
- ///
- ///
- /// NetApp Account object supplied in the body of the operation.
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
///
/// The name of the NetApp account
///
+ ///
+ /// NetApp Account object supplied in the body of the operation.
+ ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -835,112 +818,113 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(NetAppAccount body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccount body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (body == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body");
}
if (body != null)
{
body.Validate();
}
- if (Client.SubscriptionId == null)
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("body", body);
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
+
+ tracingParameters.Add("body", body);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -952,61 +936,62 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(body != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1016,9 +1001,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1029,16 +1015,16 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
// Deserialize Response
@@ -1047,31 +1033,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Delete a NetApp account
- ///
- ///
/// Delete the specified NetApp account
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -1084,10 +1071,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1096,103 +1083,104 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion == null)
{
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1204,55 +1192,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1262,48 +1251,50 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Update a NetApp account
- ///
- ///
/// Patch the specified NetApp account
- ///
- ///
- /// NetApp Account object supplied in the body of the operation.
- ///
+ ///
///
/// The name of the resource group. The name is case insensitive.
///
///
/// The name of the NetApp account
///
+ ///
+ /// NetApp Account object supplied in the body of the operation.
+ ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1312,108 +1303,109 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginUpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NetAppAccountPatch body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (body == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "body");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body");
}
- if (Client.SubscriptionId == null)
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion == null)
{
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("body", body);
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
+
+ tracingParameters.Add("body", body);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PATCH");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1425,61 +1417,62 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(body != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1489,9 +1482,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1502,16 +1496,16 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
// Deserialize Response
@@ -1520,33 +1514,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Renew identity credentials
+ /// Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
///
- ///
- /// Renew identity credentials that are used to authenticate to key vault, for
- /// customer-managed key encryption. If encryption.identity.principalId does
- /// not match identity.principalId, running this operation will fix it.
- ///
///
/// The name of the resource group. The name is case insensitive.
///
@@ -1559,10 +1552,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1571,103 +1564,104 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.SubscriptionId != null)
+ if (this.Client.SubscriptionId != null)
{
- if (Client.SubscriptionId.Length < 1)
+ if (this.Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (accountName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName");
}
if (accountName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"))
{
- throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$");
}
}
- if (Client.ApiVersion == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (Client.ApiVersion != null)
- {
- if (Client.ApiVersion.Length < 1)
- {
- throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
- }
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("accountName", accountName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginRenewCredentials", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRenewCredentials", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/renewCredentials").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1679,55 +1673,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1737,26 +1732,28 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Describe all NetApp Accounts in a subscription
- ///
- ///
/// List and describe all NetApp accounts in the subscription.
- ///
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -1766,13 +1763,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1781,51 +1778,54 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
if (nextPageLink == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1837,55 +1837,56 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1895,9 +1896,10 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
@@ -1908,31 +1910,32 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Describe all NetApp Accounts in a resource group
- ///
- ///
/// List and describe all NetApp accounts in the resource group.
- ///
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -1942,13 +1945,13 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -1957,51 +1960,54 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
if (nextPageLink == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- List