From 3f72b7255ca0fb75ec9368360047331cfdc03c75 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 17 Dec 2020 10:12:27 +0000 Subject: [PATCH] CodeGen from PR 11832 in Azure/azure-rest-api-specs Merge 3a1ed3e7b32f3d480cce60e2d85597f55441c8a8 into adfab4370eacdbea9ab8eae0594c4b0849df0b4c --- .../AzureNetAppFilesManagementClient.cs | 2 +- .../Generated/ISnapshotPoliciesOperations.cs | 2 +- .../src/Generated/IVolumesOperations.cs | 31 ++- .../src/Generated/Models/ActiveDirectory.cs | 16 +- .../src/Generated/Models/Page1.cs | 53 +++++ .../src/Generated/Models/Volume.cs | 48 +++-- .../src/Generated/Models/VolumePatch.cs | 23 +-- .../SdkInfo_NetAppManagementClient.cs | 33 ++-- .../Generated/SnapshotPoliciesOperations.cs | 2 +- .../SnapshotPoliciesOperationsExtensions.cs | 4 +- .../src/Generated/VolumesOperations.cs | 186 +++++++++++++++++- .../Generated/VolumesOperationsExtensions.cs | 54 ++++- 12 files changed, 383 insertions(+), 71 deletions(-) create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Page1.cs diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs index 37d3b033aad2..5b5a8b951dbd 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs @@ -384,7 +384,7 @@ private void Initialize() BackupPolicies = new BackupPoliciesOperations(this); Vaults = new VaultsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-07-01"; + ApiVersion = "2020-09-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs index 63cc2a0983c5..1a4642aa2444 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotPoliciesOperations.cs @@ -164,7 +164,7 @@ public partial interface ISnapshotPoliciesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string snapshotPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get volumes associated with snapshot policy + /// Get volumes for snapshot policy /// /// /// Get volumes associated with snapshot policy diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs index ecceebb84c5a..d8e4bc3b08a0 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs @@ -53,7 +53,7 @@ public partial interface IVolumesOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Describe a volume /// @@ -302,7 +302,7 @@ public partial interface IVolumesOperations /// /// Resync the connection on the destination volume. If the operation /// is ran on the source volume it will reverse-resync the connection - /// and sync from source to destination. + /// and sync from destination to source. /// /// /// The name of the resource group. @@ -640,7 +640,7 @@ public partial interface IVolumesOperations /// /// Resync the connection on the destination volume. If the operation /// is ran on the source volume it will reverse-resync the connection - /// and sync from source to destination. + /// and sync from destination to source. /// /// /// The name of the resource group. @@ -798,5 +798,30 @@ public partial interface IVolumesOperations /// Thrown when a required parameter is null /// Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Describe all volumes + /// + /// + /// List all volumes within the capacity pool + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs index f26dd4631148..9729d0158ea3 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs @@ -70,7 +70,11 @@ public ActiveDirectory() /// enabled for SMB communication. /// Specifies whether or not the LDAP traffic /// needs to be signed. - public ActiveDirectory(string activeDirectoryId = default(string), string username = default(string), string password = default(string), string domain = default(string), string dns = default(string), string status = default(string), string statusDetails = default(string), string smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), IList backupOperators = default(IList), string kdcIP = default(string), string adName = default(string), string serverRootCACertificate = default(string), bool? aesEncryption = default(bool?), bool? ldapSigning = default(bool?)) + /// Domain Users in the Active + /// directory to be given SeSecurityPrivilege privilege (Needed for SMB + /// Continuously available shares for SQL). A list of unique usernames + /// without domain specifier + public ActiveDirectory(string activeDirectoryId = default(string), string username = default(string), string password = default(string), string domain = default(string), string dns = default(string), string status = default(string), string statusDetails = default(string), string smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), IList backupOperators = default(IList), string kdcIP = default(string), string adName = default(string), string serverRootCACertificate = default(string), bool? aesEncryption = default(bool?), bool? ldapSigning = default(bool?), IList securityOperators = default(IList)) { ActiveDirectoryId = activeDirectoryId; Username = username; @@ -88,6 +92,7 @@ public ActiveDirectory() ServerRootCACertificate = serverRootCACertificate; AesEncryption = aesEncryption; LdapSigning = ldapSigning; + SecurityOperators = securityOperators; CustomInit(); } @@ -209,6 +214,15 @@ public ActiveDirectory() [JsonProperty(PropertyName = "ldapSigning")] public bool? LdapSigning { get; set; } + /// + /// Gets or sets domain Users in the Active directory to be given + /// SeSecurityPrivilege privilege (Needed for SMB Continuously + /// available shares for SQL). A list of unique usernames without + /// domain specifier + /// + [JsonProperty(PropertyName = "securityOperators")] + public IList SecurityOperators { get; set; } + /// /// Validate the object. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Page1.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Page1.cs new file mode 100644 index 000000000000..0c8fd79cf5ec --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs index d8c8f9511b94..6e5d5c2d9c41 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs @@ -64,9 +64,15 @@ public Volume() /// later /// The security style of volume. Possible /// values include: 'ntfs', 'unix' + /// Enables encryption for in-flight smb3 + /// data. Only applicable for SMB/DualProtocol volume. To be used with + /// swagger version 2020-08-01 or later + /// Enables continuously + /// available share property for smb volume. Only applicable for SMB + /// volume /// Maximum throughput in Mibps that can /// be achieved by this volume - public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), string backupId = default(string), string baremetalTenantId = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), double? throughputMibps = default(double?)) + public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), string backupId = default(string), string baremetalTenantId = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?)) { Location = location; Id = id; @@ -91,6 +97,8 @@ public Volume() SnapshotDirectoryVisible = snapshotDirectoryVisible; KerberosEnabled = kerberosEnabled; SecurityStyle = securityStyle; + SmbEncryption = smbEncryption; + SmbContinuouslyAvailable = smbContinuouslyAvailable; ThroughputMibps = throughputMibps; CustomInit(); } @@ -280,6 +288,21 @@ public Volume() [JsonProperty(PropertyName = "properties.securityStyle")] public string SecurityStyle { get; set; } + /// + /// Gets or sets enables encryption for in-flight smb3 data. Only + /// applicable for SMB/DualProtocol volume. To be used with swagger + /// version 2020-08-01 or later + /// + [JsonProperty(PropertyName = "properties.smbEncryption")] + public bool? SmbEncryption { get; set; } + + /// + /// Gets or sets enables continuously available share property for smb + /// volume. Only applicable for SMB volume + /// + [JsonProperty(PropertyName = "properties.smbContinuouslyAvailable")] + public bool? SmbContinuouslyAvailable { get; set; } + /// /// Gets or sets maximum throughput in Mibps that can be achieved by /// this volume @@ -389,20 +412,17 @@ public virtual void Validate() { DataProtection.Validate(); } - if (ThroughputMibps != null) + if (ThroughputMibps > 4500) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); - } - if (ThroughputMibps % 0.001 != 0) - { - throw new ValidationException(ValidationRules.MultipleOf, "ThroughputMibps", 0.001); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); + } + if (ThroughputMibps < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); + } + if (ThroughputMibps % 0.001 != 0) + { + throw new ValidationException(ValidationRules.MultipleOf, "ThroughputMibps", 0.001); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs index 543337bb8bec..36aa82bfa9e0 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs @@ -159,20 +159,17 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } - if (ThroughputMibps != null) + if (ThroughputMibps > 4500) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); - } - if (ThroughputMibps % 0.001 != 0) - { - throw new ValidationException(ValidationRules.MultipleOf, "ThroughputMibps", 0.001); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); + } + if (ThroughputMibps < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); + } + if (ThroughputMibps % 0.001 != 0) + { + throw new ValidationException(ValidationRules.MultipleOf, "ThroughputMibps", 0.001); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs index de998c60070b..ac0706463a95 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs @@ -19,30 +19,19 @@ public static IEnumerable> ApiInfo_NetAppManagemen { return new Tuple[] { - new Tuple("NetApp", "AccountBackups", "2020-07-01"), - new Tuple("NetApp", "Accounts", "2020-07-01"), - new Tuple("NetApp", "BackupPolicies", "2020-07-01"), - new Tuple("NetApp", "Backups", "2020-07-01"), - new Tuple("NetApp", "NetAppResource", "2020-07-01"), - new Tuple("NetApp", "Operations", "2020-07-01"), - new Tuple("NetApp", "Pools", "2020-07-01"), - new Tuple("NetApp", "SnapshotPolicies", "2020-07-01"), - new Tuple("NetApp", "Snapshots", "2020-07-01"), - new Tuple("NetApp", "Vaults", "2020-07-01"), - new Tuple("NetApp", "Volumes", "2020-07-01"), + new Tuple("NetApp", "AccountBackups", "2020-09-01"), + new Tuple("NetApp", "Accounts", "2020-09-01"), + new Tuple("NetApp", "BackupPolicies", "2020-09-01"), + new Tuple("NetApp", "Backups", "2020-09-01"), + new Tuple("NetApp", "NetAppResource", "2020-09-01"), + new Tuple("NetApp", "Operations", "2020-09-01"), + new Tuple("NetApp", "Pools", "2020-09-01"), + new Tuple("NetApp", "SnapshotPolicies", "2020-09-01"), + new Tuple("NetApp", "Snapshots", "2020-09-01"), + new Tuple("NetApp", "Vaults", "2020-09-01"), + new Tuple("NetApp", "Volumes", "2020-09-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/netapp/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\audunn\\Source\\repos\\azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "9563d064dabcf535e35a52bc2e0e3ada4e74e64f"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperations.cs index 7244fec1919d..e1afb4fdaefc 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperations.cs @@ -997,7 +997,7 @@ internal SnapshotPoliciesOperations(AzureNetAppFilesManagementClient client) } /// - /// Get volumes associated with snapshot policy + /// Get volumes for snapshot policy /// /// /// Get volumes associated with snapshot policy diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperationsExtensions.cs index 6410518988fa..9f7963971506 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotPoliciesOperationsExtensions.cs @@ -257,7 +257,7 @@ public static void Delete(this ISnapshotPoliciesOperations operations, string re } /// - /// Get volumes associated with snapshot policy + /// Get volumes for snapshot policy /// /// /// Get volumes associated with snapshot policy @@ -280,7 +280,7 @@ public static SnapshotPolicyVolumeList ListVolumes(this ISnapshotPoliciesOperati } /// - /// Get volumes associated with snapshot policy + /// Get volumes for snapshot policy /// /// /// Get volumes associated with snapshot policy diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs index c2c96cb40f9c..08cefa130248 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs @@ -86,7 +86,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -256,7 +256,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -269,7 +269,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -985,7 +985,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// Resync the connection on the destination volume. If the operation is ran on /// the source volume it will reverse-resync the connection and sync from - /// source to destination. + /// destination to source. /// /// /// The name of the resource group. @@ -2470,7 +2470,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// Resync the connection on the destination volume. If the operation is ran on /// the source volume it will reverse-resync the connection and sync from - /// source to destination. + /// destination to source. /// /// /// The name of the resource group. @@ -3704,5 +3704,181 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) return _result; } + /// + /// Describe all volumes + /// + /// + /// List all volumes within the capacity pool + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs index 69c16239e7a9..87806f926117 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs @@ -13,8 +13,6 @@ 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; @@ -41,7 +39,7 @@ public static partial class VolumesOperationsExtensions /// /// The name of the capacity pool /// - public static IEnumerable List(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName) + public static IPage List(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName) { return operations.ListAsync(resourceGroupName, accountName, poolName).GetAwaiter().GetResult(); } @@ -67,7 +65,7 @@ public static IEnumerable List(this IVolumesOperations operations, strin /// /// The cancellation token. /// - public static async Task> ListAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, poolName, null, cancellationToken).ConfigureAwait(false)) { @@ -502,7 +500,7 @@ public static ReplicationStatus ReplicationStatusMethod(this IVolumesOperations /// /// Resync the connection on the destination volume. If the operation is ran on /// the source volume it will reverse-resync the connection and sync from - /// source to destination. + /// destination to source. /// /// /// The operations group for this extension method. @@ -530,7 +528,7 @@ public static void ResyncReplication(this IVolumesOperations operations, string /// /// Resync the connection on the destination volume. If the operation is ran on /// the source volume it will reverse-resync the connection and sync from - /// source to destination. + /// destination to source. /// /// /// The operations group for this extension method. @@ -1100,7 +1098,7 @@ public static void BeginRevert(this IVolumesOperations operations, string resour /// /// Resync the connection on the destination volume. If the operation is ran on /// the source volume it will reverse-resync the connection and sync from - /// source to destination. + /// destination to source. /// /// /// The operations group for this extension method. @@ -1128,7 +1126,7 @@ public static void BeginResyncReplication(this IVolumesOperations operations, st /// /// Resync the connection on the destination volume. If the operation is ran on /// the source volume it will reverse-resync the connection and sync from - /// source to destination. + /// destination to source. /// /// /// The operations group for this extension method. @@ -1387,5 +1385,45 @@ public static void BeginPoolChange(this IVolumesOperations operations, string re (await operations.BeginPoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Describe all volumes + /// + /// + /// List all volumes within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IVolumesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Describe all volumes + /// + /// + /// List all volumes within the capacity pool + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IVolumesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } }