diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperations.cs index d0901c7f0ae9..bc68df278143 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperations.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperations.cs @@ -70,6 +70,10 @@ internal FileSharesOperations(StorageManagementClient client) /// Optional. When specified, only share names starting with the filter will be /// listed. /// + /// + /// Optional, used to expand the properties within share's properties. Possible + /// values include: 'deleted' + /// /// /// Headers that will be added to request. /// @@ -91,7 +95,7 @@ internal FileSharesOperations(StorageManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), ListSharesExpand? expand = default(ListSharesExpand?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -160,6 +164,7 @@ internal FileSharesOperations(StorageManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("maxpagesize", maxpagesize); tracingParameters.Add("filter", filter); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -182,6 +187,10 @@ internal FileSharesOperations(StorageManagementClient client) { _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -327,13 +336,8 @@ internal FileSharesOperations(StorageManagementClient client) /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - /// - /// A name-value pair to associate with the share as metadata. - /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than 0, and - /// less than or equal to 5TB (5120). For Large File Shares, the maximum size - /// is 102400. + /// + /// Properties of the file share to create. /// /// /// Headers that will be added to request. @@ -356,7 +360,7 @@ internal FileSharesOperations(StorageManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -407,6 +411,14 @@ internal FileSharesOperations(StorageManagementClient client) throw new ValidationException(ValidationRules.MinLength, "shareName", 3); } } + if (fileShare == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fileShare"); + } + if (fileShare != null) + { + fileShare.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -429,20 +441,6 @@ internal FileSharesOperations(StorageManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (shareQuota > 102400) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "shareQuota", 102400); - } - if (shareQuota < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "shareQuota", 1); - } - FileShare fileShare = new FileShare(); - if (metadata != null || shareQuota != null) - { - fileShare.Metadata = metadata; - fileShare.ShareQuota = shareQuota; - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -638,13 +636,8 @@ internal FileSharesOperations(StorageManagementClient client) /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - /// - /// A name-value pair to associate with the share as metadata. - /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than 0, and - /// less than or equal to 5TB (5120). For Large File Shares, the maximum size - /// is 102400. + /// + /// Properties to update for the file share. /// /// /// Headers that will be added to request. @@ -667,7 +660,7 @@ internal FileSharesOperations(StorageManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -718,6 +711,10 @@ internal FileSharesOperations(StorageManagementClient client) throw new ValidationException(ValidationRules.MinLength, "shareName", 3); } } + if (fileShare == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fileShare"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -740,20 +737,6 @@ internal FileSharesOperations(StorageManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (shareQuota > 102400) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "shareQuota", 102400); - } - if (shareQuota < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "shareQuota", 1); - } - FileShare fileShare = new FileShare(); - if (metadata != null || shareQuota != null) - { - fileShare.Metadata = metadata; - fileShare.ShareQuota = shareQuota; - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -929,6 +912,10 @@ internal FileSharesOperations(StorageManagementClient client) /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// + /// + /// Optional, used to expand the properties within share's properties. Possible + /// values include: 'stats' + /// /// /// Headers that will be added to request. /// @@ -950,7 +937,7 @@ internal FileSharesOperations(StorageManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, GetShareExpand? expand = default(GetShareExpand?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1033,6 +1020,7 @@ internal FileSharesOperations(StorageManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -1048,6 +1036,10 @@ internal FileSharesOperations(StorageManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1414,6 +1406,275 @@ internal FileSharesOperations(StorageManagementClient client) return _result; } + /// + /// Restore a file share within a valid retention days if share soft delete is + /// enabled + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the storage account within the specified resource group. + /// Storage account names must be between 3 and 24 characters in length and use + /// numbers and lower-case letters only. + /// + /// + /// The name of the file share within the specified storage account. File share + /// names must be between 3 and 63 characters in length and use numbers, + /// lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// + /// + /// Required. Identify the name of the deleted share that will be restored. + /// + /// + /// Required. Identify the version of the deleted share that will be restored. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task RestoreWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + } + if (shareName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); + } + if (shareName != null) + { + if (shareName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "shareName", 63); + } + if (shareName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "shareName", 3); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (deletedShareName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deletedShareName"); + } + if (deletedShareVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deletedShareVersion"); + } + DeletedShare deletedShare = new DeletedShare(); + if (deletedShareName != null || deletedShareVersion != null) + { + deletedShare.DeletedShareName = deletedShareName; + deletedShare.DeletedShareVersion = deletedShareVersion; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("shareName", shareName); + tracingParameters.Add("deletedShare", deletedShare); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Restore", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{shareName}", System.Uri.EscapeDataString(shareName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(deletedShare != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(deletedShare, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Lists all shares. /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperationsExtensions.cs index 54edc95e74a6..624479ab1993 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperationsExtensions.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileSharesOperationsExtensions.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.Storage using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -46,9 +44,13 @@ public static partial class FileSharesOperationsExtensions /// Optional. When specified, only share names starting with the filter will be /// listed. /// - public static IPage List(this IFileSharesOperations operations, string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string)) + /// + /// Optional, used to expand the properties within share's properties. Possible + /// values include: 'deleted' + /// + public static IPage List(this IFileSharesOperations operations, string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), ListSharesExpand? expand = default(ListSharesExpand?)) { - return operations.ListAsync(resourceGroupName, accountName, maxpagesize, filter).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, accountName, maxpagesize, filter, expand).GetAwaiter().GetResult(); } /// @@ -74,12 +76,16 @@ public static partial class FileSharesOperationsExtensions /// Optional. When specified, only share names starting with the filter will be /// listed. /// + /// + /// Optional, used to expand the properties within share's properties. Possible + /// values include: 'deleted' + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), ListSharesExpand? expand = default(ListSharesExpand?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, maxpagesize, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, maxpagesize, filter, expand, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -108,17 +114,12 @@ public static partial class FileSharesOperationsExtensions /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - /// - /// A name-value pair to associate with the share as metadata. + /// + /// Properties of the file share to create. /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than 0, and - /// less than or equal to 5TB (5120). For Large File Shares, the maximum size - /// is 102400. - /// - public static FileShare Create(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?)) + public static FileShare Create(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, FileShare fileShare) { - return operations.CreateAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, shareName, fileShare).GetAwaiter().GetResult(); } /// @@ -144,20 +145,15 @@ public static partial class FileSharesOperationsExtensions /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - /// - /// A name-value pair to associate with the share as metadata. - /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than 0, and - /// less than or equal to 5TB (5120). For Large File Shares, the maximum size - /// is 102400. + /// + /// Properties of the file share to create. /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, metadata, shareQuota, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, fileShare, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -186,17 +182,12 @@ public static partial class FileSharesOperationsExtensions /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - /// - /// A name-value pair to associate with the share as metadata. + /// + /// Properties to update for the file share. /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than 0, and - /// less than or equal to 5TB (5120). For Large File Shares, the maximum size - /// is 102400. - /// - public static FileShare Update(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?)) + public static FileShare Update(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, FileShare fileShare) { - return operations.UpdateAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, accountName, shareName, fileShare).GetAwaiter().GetResult(); } /// @@ -222,20 +213,15 @@ public static partial class FileSharesOperationsExtensions /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - /// - /// A name-value pair to associate with the share as metadata. - /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than 0, and - /// less than or equal to 5TB (5120). For Large File Shares, the maximum size - /// is 102400. + /// + /// Properties to update for the file share. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, metadata, shareQuota, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, fileShare, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -262,9 +248,13 @@ public static partial class FileSharesOperationsExtensions /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// - public static FileShare Get(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName) + /// + /// Optional, used to expand the properties within share's properties. Possible + /// values include: 'stats' + /// + public static FileShare Get(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, GetShareExpand? expand = default(GetShareExpand?)) { - return operations.GetAsync(resourceGroupName, accountName, shareName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName, shareName, expand).GetAwaiter().GetResult(); } /// @@ -288,12 +278,16 @@ public static FileShare Get(this IFileSharesOperations operations, string resour /// lower-case letters and dash (-) only. Every dash (-) character must be /// immediately preceded and followed by a letter or number. /// + /// + /// Optional, used to expand the properties within share's properties. Possible + /// values include: 'stats' + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, GetShareExpand? expand = default(GetShareExpand?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, shareName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, shareName, expand, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -354,6 +348,75 @@ public static void Delete(this IFileSharesOperations operations, string resource (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Restore a file share within a valid retention days if share soft delete is + /// enabled + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the storage account within the specified resource group. + /// Storage account names must be between 3 and 24 characters in length and use + /// numbers and lower-case letters only. + /// + /// + /// The name of the file share within the specified storage account. File share + /// names must be between 3 and 63 characters in length and use numbers, + /// lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// + /// + /// Required. Identify the name of the deleted share that will be restored. + /// + /// + /// Required. Identify the version of the deleted share that will be restored. + /// + public static void Restore(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion) + { + operations.RestoreAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).GetAwaiter().GetResult(); + } + + /// + /// Restore a file share within a valid retention days if share soft delete is + /// enabled + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The name of the storage account within the specified resource group. + /// Storage account names must be between 3 and 24 characters in length and use + /// numbers and lower-case letters only. + /// + /// + /// The name of the file share within the specified storage account. File share + /// names must be between 3 and 63 characters in length and use numbers, + /// lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// + /// + /// Required. Identify the name of the deleted share that will be restored. + /// + /// + /// Required. Identify the version of the deleted share that will be restored. + /// + /// + /// The cancellation token. + /// + public static async Task RestoreAsync(this IFileSharesOperations operations, string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestoreWithHttpMessagesAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Lists all shares. /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileSharesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileSharesOperations.cs index 218608b2dcd2..115dde0199fd 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileSharesOperations.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileSharesOperations.cs @@ -43,6 +43,10 @@ public partial interface IFileSharesOperations /// Optional. When specified, only share names starting with the filter /// will be listed. /// + /// + /// Optional, used to expand the properties within share's properties. + /// Possible values include: 'deleted' + /// /// /// The headers that will be added to request. /// @@ -58,7 +62,7 @@ public partial interface IFileSharesOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, string maxpagesize = default(string), string filter = default(string), ListSharesExpand? expand = default(ListSharesExpand?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates a new share under the specified account as described by /// request body. The share resource includes metadata and properties @@ -81,13 +85,8 @@ public partial interface IFileSharesOperations /// character must be immediately preceded and followed by a letter or /// number. /// - /// - /// A name-value pair to associate with the share as metadata. - /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than - /// 0, and less than or equal to 5TB (5120). For Large File Shares, the - /// maximum size is 102400. + /// + /// Properties of the file share to create. /// /// /// The headers that will be added to request. @@ -104,7 +103,7 @@ public partial interface IFileSharesOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates share properties as specified in request body. Properties /// not mentioned in the request will not be changed. Update fails if @@ -126,13 +125,8 @@ public partial interface IFileSharesOperations /// character must be immediately preceded and followed by a letter or /// number. /// - /// - /// A name-value pair to associate with the share as metadata. - /// - /// - /// The maximum size of the share, in gigabytes. Must be greater than - /// 0, and less than or equal to 5TB (5120). For Large File Shares, the - /// maximum size is 102400. + /// + /// Properties to update for the file share. /// /// /// The headers that will be added to request. @@ -149,7 +143,7 @@ public partial interface IFileSharesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets properties of a specified share. /// @@ -169,6 +163,10 @@ public partial interface IFileSharesOperations /// character must be immediately preceded and followed by a letter or /// number. /// + /// + /// Optional, used to expand the properties within share's properties. + /// Possible values include: 'stats' + /// /// /// The headers that will be added to request. /// @@ -184,7 +182,7 @@ public partial interface IFileSharesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, GetShareExpand? expand = default(GetShareExpand?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes specified share under its account. /// @@ -218,6 +216,47 @@ public partial interface IFileSharesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Restore a file share within a valid retention days if share soft + /// delete is enabled + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The name of the storage account within the specified resource + /// group. Storage account names must be between 3 and 24 characters in + /// length and use numbers and lower-case letters only. + /// + /// + /// The name of the file share within the specified storage account. + /// File share names must be between 3 and 63 characters in length and + /// use numbers, lower-case letters and dash (-) only. Every dash (-) + /// character must be immediately preceded and followed by a letter or + /// number. + /// + /// + /// Required. Identify the name of the deleted share that will be + /// restored. + /// + /// + /// Required. Identify the version of the deleted share that will be + /// restored. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestoreWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all shares. /// /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISKUsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISkusOperations.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISKUsOperations.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISkusOperations.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedShare.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedShare.cs new file mode 100644 index 000000000000..972f5b5e8c98 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedShare.cs @@ -0,0 +1,81 @@ +// +// 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.Storage.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The deleted share to be restored. + /// + public partial class DeletedShare + { + /// + /// Initializes a new instance of the DeletedShare class. + /// + public DeletedShare() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeletedShare class. + /// + /// Required. Identify the name of the + /// deleted share that will be restored. + /// Required. Identify the version of + /// the deleted share that will be restored. + public DeletedShare(string deletedShareName, string deletedShareVersion) + { + DeletedShareName = deletedShareName; + DeletedShareVersion = deletedShareVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets required. Identify the name of the deleted share that + /// will be restored. + /// + [JsonProperty(PropertyName = "deletedShareName")] + public string DeletedShareName { get; set; } + + /// + /// Gets or sets required. Identify the version of the deleted share + /// that will be restored. + /// + [JsonProperty(PropertyName = "deletedShareVersion")] + public string DeletedShareVersion { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DeletedShareName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DeletedShareName"); + } + if (DeletedShareVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DeletedShareVersion"); + } + } + } +} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EnabledProtocols.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EnabledProtocols.cs new file mode 100644 index 000000000000..cf1bf1f32f6b --- /dev/null +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EnabledProtocols.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Storage.Models +{ + + /// + /// Defines values for EnabledProtocols. + /// + public static class EnabledProtocols + { + public const string SMB = "SMB"; + public const string NFS = "NFS"; + } +} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShare.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShare.cs index 807a898ae4ee..97fe3190ccbe 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShare.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShare.cs @@ -49,12 +49,46 @@ public FileShare() /// The maximum size of the share, in /// gigabytes. Must be greater than 0, and less than or equal to 5TB /// (5120). For Large File Shares, the maximum size is 102400. - public FileShare(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IDictionary metadata = default(IDictionary), int? shareQuota = default(int?)) + /// The authentication protocol that is + /// used for the file share. Can only be specified when creating a + /// share. Possible values include: 'SMB', 'NFS' + /// The property is for NFS share only. The + /// default is NoRootSquash. Possible values include: 'NoRootSquash', + /// 'RootSquash', 'AllSquash' + /// The version of the share. + /// Indicates whether the share was + /// deleted. + /// The deleted time if the share was + /// deleted. + /// Remaining retention days for + /// share that was soft deleted. + /// Access tier for specific share. GpV2 + /// account can choose between TransactionOptimized (default), Hot, and + /// Cool. FileStorage account can choose Premium. Possible values + /// include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + /// Indicates the last modification + /// time for share access tier. + /// Indicates if there is a pending + /// transition for access tier. + /// The approximate size of the data + /// stored on the share. Note that this value may not include all + /// recently created or recently resized files. + public FileShare(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), string enabledProtocols = default(string), string rootSquash = default(string), string version = default(string), bool? deleted = default(bool?), System.DateTime? deletedTime = default(System.DateTime?), int? remainingRetentionDays = default(int?), string accessTier = default(string), System.DateTime? accessTierChangeTime = default(System.DateTime?), string accessTierStatus = default(string), int? shareUsageBytes = default(int?)) : base(id, name, type, etag) { LastModifiedTime = lastModifiedTime; Metadata = metadata; ShareQuota = shareQuota; + EnabledProtocols = enabledProtocols; + RootSquash = rootSquash; + Version = version; + Deleted = deleted; + DeletedTime = deletedTime; + RemainingRetentionDays = remainingRetentionDays; + AccessTier = accessTier; + AccessTierChangeTime = accessTierChangeTime; + AccessTierStatus = accessTierStatus; + ShareUsageBytes = shareUsageBytes; CustomInit(); } @@ -84,6 +118,75 @@ public FileShare() [JsonProperty(PropertyName = "properties.shareQuota")] public int? ShareQuota { get; set; } + /// + /// Gets or sets the authentication protocol that is used for the file + /// share. Can only be specified when creating a share. Possible values + /// include: 'SMB', 'NFS' + /// + [JsonProperty(PropertyName = "properties.enabledProtocols")] + public string EnabledProtocols { get; set; } + + /// + /// Gets or sets the property is for NFS share only. The default is + /// NoRootSquash. Possible values include: 'NoRootSquash', + /// 'RootSquash', 'AllSquash' + /// + [JsonProperty(PropertyName = "properties.rootSquash")] + public string RootSquash { get; set; } + + /// + /// Gets the version of the share. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; private set; } + + /// + /// Gets indicates whether the share was deleted. + /// + [JsonProperty(PropertyName = "properties.deleted")] + public bool? Deleted { get; private set; } + + /// + /// Gets the deleted time if the share was deleted. + /// + [JsonProperty(PropertyName = "properties.deletedTime")] + public System.DateTime? DeletedTime { get; private set; } + + /// + /// Gets remaining retention days for share that was soft deleted. + /// + [JsonProperty(PropertyName = "properties.remainingRetentionDays")] + public int? RemainingRetentionDays { get; private set; } + + /// + /// Gets or sets access tier for specific share. GpV2 account can + /// choose between TransactionOptimized (default), Hot, and Cool. + /// FileStorage account can choose Premium. Possible values include: + /// 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + /// + [JsonProperty(PropertyName = "properties.accessTier")] + public string AccessTier { get; set; } + + /// + /// Gets indicates the last modification time for share access tier. + /// + [JsonProperty(PropertyName = "properties.accessTierChangeTime")] + public System.DateTime? AccessTierChangeTime { get; private set; } + + /// + /// Gets indicates if there is a pending transition for access tier. + /// + [JsonProperty(PropertyName = "properties.accessTierStatus")] + public string AccessTierStatus { get; private set; } + + /// + /// Gets the approximate size of the data stored on the share. Note + /// that this value may not include all recently created or recently + /// resized files. + /// + [JsonProperty(PropertyName = "properties.shareUsageBytes")] + public int? ShareUsageBytes { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShareItem.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShareItem.cs index b6b4e9800040..adf2bb17c0eb 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShareItem.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileShareItem.cs @@ -48,12 +48,46 @@ public FileShareItem() /// The maximum size of the share, in /// gigabytes. Must be greater than 0, and less than or equal to 5TB /// (5120). For Large File Shares, the maximum size is 102400. - public FileShareItem(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IDictionary metadata = default(IDictionary), int? shareQuota = default(int?)) + /// The authentication protocol that is + /// used for the file share. Can only be specified when creating a + /// share. Possible values include: 'SMB', 'NFS' + /// The property is for NFS share only. The + /// default is NoRootSquash. Possible values include: 'NoRootSquash', + /// 'RootSquash', 'AllSquash' + /// The version of the share. + /// Indicates whether the share was + /// deleted. + /// The deleted time if the share was + /// deleted. + /// Remaining retention days for + /// share that was soft deleted. + /// Access tier for specific share. GpV2 + /// account can choose between TransactionOptimized (default), Hot, and + /// Cool. FileStorage account can choose Premium. Possible values + /// include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + /// Indicates the last modification + /// time for share access tier. + /// Indicates if there is a pending + /// transition for access tier. + /// The approximate size of the data + /// stored on the share. Note that this value may not include all + /// recently created or recently resized files. + public FileShareItem(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IDictionary metadata = default(IDictionary), int? shareQuota = default(int?), string enabledProtocols = default(string), string rootSquash = default(string), string version = default(string), bool? deleted = default(bool?), System.DateTime? deletedTime = default(System.DateTime?), int? remainingRetentionDays = default(int?), string accessTier = default(string), System.DateTime? accessTierChangeTime = default(System.DateTime?), string accessTierStatus = default(string), int? shareUsageBytes = default(int?)) : base(id, name, type, etag) { LastModifiedTime = lastModifiedTime; Metadata = metadata; ShareQuota = shareQuota; + EnabledProtocols = enabledProtocols; + RootSquash = rootSquash; + Version = version; + Deleted = deleted; + DeletedTime = deletedTime; + RemainingRetentionDays = remainingRetentionDays; + AccessTier = accessTier; + AccessTierChangeTime = accessTierChangeTime; + AccessTierStatus = accessTierStatus; + ShareUsageBytes = shareUsageBytes; CustomInit(); } @@ -83,6 +117,75 @@ public FileShareItem() [JsonProperty(PropertyName = "properties.shareQuota")] public int? ShareQuota { get; set; } + /// + /// Gets or sets the authentication protocol that is used for the file + /// share. Can only be specified when creating a share. Possible values + /// include: 'SMB', 'NFS' + /// + [JsonProperty(PropertyName = "properties.enabledProtocols")] + public string EnabledProtocols { get; set; } + + /// + /// Gets or sets the property is for NFS share only. The default is + /// NoRootSquash. Possible values include: 'NoRootSquash', + /// 'RootSquash', 'AllSquash' + /// + [JsonProperty(PropertyName = "properties.rootSquash")] + public string RootSquash { get; set; } + + /// + /// Gets the version of the share. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; private set; } + + /// + /// Gets indicates whether the share was deleted. + /// + [JsonProperty(PropertyName = "properties.deleted")] + public bool? Deleted { get; private set; } + + /// + /// Gets the deleted time if the share was deleted. + /// + [JsonProperty(PropertyName = "properties.deletedTime")] + public System.DateTime? DeletedTime { get; private set; } + + /// + /// Gets remaining retention days for share that was soft deleted. + /// + [JsonProperty(PropertyName = "properties.remainingRetentionDays")] + public int? RemainingRetentionDays { get; private set; } + + /// + /// Gets or sets access tier for specific share. GpV2 account can + /// choose between TransactionOptimized (default), Hot, and Cool. + /// FileStorage account can choose Premium. Possible values include: + /// 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + /// + [JsonProperty(PropertyName = "properties.accessTier")] + public string AccessTier { get; set; } + + /// + /// Gets indicates the last modification time for share access tier. + /// + [JsonProperty(PropertyName = "properties.accessTierChangeTime")] + public System.DateTime? AccessTierChangeTime { get; private set; } + + /// + /// Gets indicates if there is a pending transition for access tier. + /// + [JsonProperty(PropertyName = "properties.accessTierStatus")] + public string AccessTierStatus { get; private set; } + + /// + /// Gets the approximate size of the data stored on the share. Note + /// that this value may not include all recently created or recently + /// resized files. + /// + [JsonProperty(PropertyName = "properties.shareUsageBytes")] + public int? ShareUsageBytes { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/GetShareExpand.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/GetShareExpand.cs new file mode 100644 index 000000000000..bbcbce51a536 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/GetShareExpand.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Storage.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for GetShareExpand. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum GetShareExpand + { + [EnumMember(Value = "stats")] + Stats + } + internal static class GetShareExpandEnumExtension + { + internal static string ToSerializedValue(this GetShareExpand? value) + { + return value == null ? null : ((GetShareExpand)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this GetShareExpand value) + { + switch( value ) + { + case GetShareExpand.Stats: + return "stats"; + } + return null; + } + + internal static GetShareExpand? ParseGetShareExpand(this string value) + { + switch( value ) + { + case "stats": + return GetShareExpand.Stats; + } + return null; + } + } +} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IpRule.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IPRule.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IpRule.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IPRule.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListSharesExpand.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListSharesExpand.cs new file mode 100644 index 000000000000..3e467985b84d --- /dev/null +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListSharesExpand.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Storage.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ListSharesExpand. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ListSharesExpand + { + [EnumMember(Value = "deleted")] + Deleted + } + internal static class ListSharesExpandEnumExtension + { + internal static string ToSerializedValue(this ListSharesExpand? value) + { + return value == null ? null : ((ListSharesExpand)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ListSharesExpand value) + { + switch( value ) + { + case ListSharesExpand.Deleted: + return "deleted"; + } + return null; + } + + internal static ListSharesExpand? ParseListSharesExpand(this string value) + { + switch( value ) + { + case "deleted": + return ListSharesExpand.Deleted; + } + return null; + } + } +} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RootSquashType.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RootSquashType.cs new file mode 100644 index 000000000000..d7f8a599a9bb --- /dev/null +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RootSquashType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Storage.Models +{ + + /// + /// Defines values for RootSquashType. + /// + public static class RootSquashType + { + public const string NoRootSquash = "NoRootSquash"; + public const string RootSquash = "RootSquash"; + public const string AllSquash = "AllSquash"; + } +} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ShareAccessTier.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ShareAccessTier.cs new file mode 100644 index 000000000000..ab202e40605b --- /dev/null +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ShareAccessTier.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Storage.Models +{ + + /// + /// Defines values for ShareAccessTier. + /// + public static class ShareAccessTier + { + public const string TransactionOptimized = "TransactionOptimized"; + public const string Hot = "Hot"; + public const string Cool = "Cool"; + public const string Premium = "Premium"; + } +} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/signedResource.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SignedResource.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/signedResource.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SignedResource.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs index 94d58d20caae..f85b5d43c637 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs @@ -35,16 +35,5 @@ public static IEnumerable> ApiInfo_StorageManageme }.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/storage/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.output-folder=C:\\code\\srpsdk\\sdk\\storage\\Microsoft.Azure.Management.Storage\\src\\Generated"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "aa811dbe89e8a95138e19b010302e2328300ee76"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperations.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperations.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperations.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperationsExtensions.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperationsExtensions.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperationsExtensions.cs