From 3bba449416687e643c1bf5ee692336838dc7cf9b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 10 Nov 2020 09:40:19 +0000 Subject: [PATCH] Generated from 3a3936bb8a4768f77047ee6ac8b8e778329bcd29 --- .../BlobInventoryPoliciesOperations.cs | 1008 ----------------- ...obInventoryPoliciesOperationsExtensions.cs | 226 ---- .../Generated/DeletedAccountsOperations.cs | 625 ---------- .../DeletedAccountsOperationsExtensions.cs | 127 --- .../src/Generated/FileServicesOperations.cs | 25 +- .../FileServicesOperationsExtensions.cs | 30 +- .../IBlobInventoryPoliciesOperations.cs | 145 --- .../Generated/IDeletedAccountsOperations.cs | 93 -- .../src/Generated/IFileServicesOperations.cs | 13 +- ...{ISKUsOperations.cs => ISkusOperations.cs} | 0 .../src/Generated/IStorageManagementClient.cs | 10 - .../Generated/Models/BlobInventoryPolicy.cs | 97 -- .../Models/BlobInventoryPolicyDefinition.cs | 73 -- .../Models/BlobInventoryPolicyFilter.cs | 100 -- .../Models/BlobInventoryPolicyRule.cs | 95 -- .../Models/BlobInventoryPolicySchema.cs | 114 -- .../Generated/Models/BlobServiceProperties.cs | 17 +- .../src/Generated/Models/CreatedByType.cs | 24 - .../Generated/Models/DateAfterModification.cs | 38 +- .../Generated/Models/DeleteRetentionPolicy.cs | 15 +- .../src/Generated/Models/DeletedAccount.cs | 98 -- .../src/Generated/Models/ErrorResponse.cs | 25 +- .../src/Generated/Models/ErrorResponseBody.cs | 63 -- .../src/Generated/Models/ExtendedLocation.cs | 61 - .../Generated/Models/ExtendedLocationTypes.cs | 21 - .../Generated/Models/FileServiceProperties.cs | 11 +- .../src/Generated/Models/FileShare.cs | 15 +- .../src/Generated/Models/FileShareItem.cs | 15 +- .../Generated/Models/{IpRule.cs => IPRule.cs} | 0 .../Models/LastAccessTimeTrackingPolicy.cs | 102 -- .../Models/ManagementPolicyBaseBlob.cs | 15 +- .../src/Generated/Models/Multichannel.cs | 52 - .../src/Generated/Models/Name.cs | 21 - .../src/Generated/Models/NetworkRuleSet.cs | 8 +- .../src/Generated/Models/ProtocolSettings.cs | 51 - .../Generated/Models/ResourceAccessRule.cs | 59 - .../Models/RestorePolicyProperties.cs | 15 +- .../{signedResource.cs => SignedResource.cs} | 0 .../src/Generated/Models/SmbSetting.cs | 53 - .../src/Generated/Models/StorageAccount.cs | 11 +- .../Models/StorageAccountCreateParameters.cs | 16 +- .../src/Generated/Models/SystemData.cs | 103 -- .../SdkInfo_StorageManagementClient.cs | 47 +- .../{SKUsOperations.cs => SkusOperations.cs} | 0 ...ensions.cs => SkusOperationsExtensions.cs} | 0 .../src/Generated/StorageManagementClient.cs | 14 +- 46 files changed, 117 insertions(+), 3634 deletions(-) delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperations.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperationsExtensions.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperations.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperationsExtensions.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobInventoryPoliciesOperations.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IDeletedAccountsOperations.cs rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/{ISKUsOperations.cs => ISkusOperations.cs} (100%) delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicy.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyDefinition.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyFilter.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyRule.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicySchema.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/CreatedByType.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedAccount.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponseBody.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocation.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocationTypes.cs rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/{IpRule.cs => IPRule.cs} (100%) delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/LastAccessTimeTrackingPolicy.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Multichannel.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Name.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ProtocolSettings.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ResourceAccessRule.cs rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/{signedResource.cs => SignedResource.cs} (100%) delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SmbSetting.cs delete mode 100644 sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SystemData.cs rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/{SKUsOperations.cs => SkusOperations.cs} (100%) rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/{SKUsOperationsExtensions.cs => SkusOperationsExtensions.cs} (100%) diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperations.cs deleted file mode 100644 index 5148921857035..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperations.cs +++ /dev/null @@ -1,1008 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BlobInventoryPoliciesOperations operations. - /// - internal partial class BlobInventoryPoliciesOperations : IServiceOperations, IBlobInventoryPoliciesOperations - { - /// - /// Initializes a new instance of the BlobInventoryPoliciesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BlobInventoryPoliciesOperations(StorageManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the StorageManagementClient - /// - public StorageManagementClient Client { get; private set; } - - /// - /// Gets the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, 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 (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); - } - } - string blobInventoryPolicyName = "default"; - // 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("blobInventoryPolicyName", blobInventoryPolicyName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{blobInventoryPolicyName}", System.Uri.EscapeDataString(blobInventoryPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Sets the blob inventory policy to the specified storage account. - /// - /// - /// 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 storage account blob inventory policy object. It is composed of policy - /// rules. - /// - /// - /// - /// - /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BlobInventoryPolicySchema policy, SystemData systemData = default(SystemData), 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 (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 (policy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "policy"); - } - if (policy != null) - { - policy.Validate(); - } - string blobInventoryPolicyName = "default"; - BlobInventoryPolicy properties = new BlobInventoryPolicy(); - if (policy != null || systemData != null) - { - properties.Policy = policy; - properties.SystemData = systemData; - } - // 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("blobInventoryPolicyName", blobInventoryPolicyName); - tracingParameters.Add("properties", properties); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/inventoryPolicies/{blobInventoryPolicyName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{blobInventoryPolicyName}", System.Uri.EscapeDataString(blobInventoryPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(properties != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(properties, 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Deletes the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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. - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, 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 (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); - } - } - string blobInventoryPolicyName = "default"; - // 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("blobInventoryPolicyName", blobInventoryPolicyName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", 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}/inventoryPolicies/{blobInventoryPolicyName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{blobInventoryPolicyName}", System.Uri.EscapeDataString(blobInventoryPolicyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Gets the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (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 (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); - } - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _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("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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperationsExtensions.cs deleted file mode 100644 index 9e0a2e856a59a..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobInventoryPoliciesOperationsExtensions.cs +++ /dev/null @@ -1,226 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BlobInventoryPoliciesOperations. - /// - public static partial class BlobInventoryPoliciesOperationsExtensions - { - /// - /// Gets the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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. - /// - public static BlobInventoryPolicy Get(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName) - { - return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Gets the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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 cancellation token. - /// - public static async Task GetAsync(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Sets the blob inventory policy to the specified storage account. - /// - /// - /// 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 storage account blob inventory policy object. It is composed of policy - /// rules. - /// - /// - /// - public static BlobInventoryPolicy CreateOrUpdate(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName, BlobInventoryPolicySchema policy, SystemData systemData = default(SystemData)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, accountName, policy, systemData).GetAwaiter().GetResult(); - } - - /// - /// Sets the blob inventory policy to the specified storage account. - /// - /// - /// 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 storage account blob inventory policy object. It is composed of policy - /// rules. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName, BlobInventoryPolicySchema policy, SystemData systemData = default(SystemData), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, policy, systemData, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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. - /// - public static void Delete(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName) - { - operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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 cancellation token. - /// - public static async Task DeleteAsync(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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. - /// - public static IEnumerable List(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName) - { - return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Gets the blob inventory policy associated with the specified storage - /// account. - /// - /// - /// 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 cancellation token. - /// - public static async Task> ListAsync(this IBlobInventoryPoliciesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperations.cs deleted file mode 100644 index 7f460316307d7..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperations.cs +++ /dev/null @@ -1,625 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// DeletedAccountsOperations operations. - /// - internal partial class DeletedAccountsOperations : IServiceOperations, IDeletedAccountsOperations - { - /// - /// Initializes a new instance of the DeletedAccountsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal DeletedAccountsOperations(StorageManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the StorageManagementClient - /// - public StorageManagementClient Client { get; private set; } - - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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); - } - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts").ToString(); - _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("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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get properties of specified deleted account resource. - /// - /// - /// Name of the deleted storage account. - /// - /// - /// The location of the deleted storage account. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string deletedAccountName, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (deletedAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "deletedAccountName"); - } - if (deletedAccountName != null) - { - if (deletedAccountName.Length > 24) - { - throw new ValidationException(ValidationRules.MaxLength, "deletedAccountName", 24); - } - if (deletedAccountName.Length < 3) - { - throw new ValidationException(ValidationRules.MinLength, "deletedAccountName", 3); - } - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - 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); - } - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("deletedAccountName", deletedAccountName); - tracingParameters.Add("location", location); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}").ToString(); - _url = _url.Replace("{deletedAccountName}", System.Uri.EscapeDataString(deletedAccountName)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _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("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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperationsExtensions.cs deleted file mode 100644 index 2df722869950b..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/DeletedAccountsOperationsExtensions.cs +++ /dev/null @@ -1,127 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DeletedAccountsOperations. - /// - public static partial class DeletedAccountsOperationsExtensions - { - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IDeletedAccountsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDeletedAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get properties of specified deleted account resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deleted storage account. - /// - /// - /// The location of the deleted storage account. - /// - public static DeletedAccount Get(this IDeletedAccountsOperations operations, string deletedAccountName, string location) - { - return operations.GetAsync(deletedAccountName, location).GetAwaiter().GetResult(); - } - - /// - /// Get properties of specified deleted account resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the deleted storage account. - /// - /// - /// The location of the deleted storage account. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDeletedAccountsOperations operations, string deletedAccountName, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(deletedAccountName, location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IDeletedAccountsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IDeletedAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperations.cs index 8d392ca789977..0355a2e192b35 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperations.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperations.cs @@ -302,9 +302,14 @@ internal FileServicesOperations(StorageManagementClient client) /// Storage account names must be between 3 and 24 characters in length and use /// numbers and lower-case letters only. /// - /// - /// The properties of file services in storage accounts, including CORS - /// (Cross-Origin Resource Sharing) rules. + /// + /// Specifies CORS rules for the File service. You can include up to five + /// CorsRule elements in the request. If no CorsRule elements are included in + /// the request body, all CORS rules will be deleted, and CORS will be disabled + /// for the File service. + /// + /// + /// The file service properties for share soft delete. /// /// /// Headers that will be added to request. @@ -327,7 +332,7 @@ internal FileServicesOperations(StorageManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, FileServiceProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -385,15 +390,17 @@ internal FileServicesOperations(StorageManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - if (parameters == null) + if (shareDeleteRetentionPolicy != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + shareDeleteRetentionPolicy.Validate(); } - if (parameters != null) + string fileServicesName = "default"; + FileServiceProperties parameters = new FileServiceProperties(); + if (cors != null || shareDeleteRetentionPolicy != null) { - parameters.Validate(); + parameters.Cors = cors; + parameters.ShareDeleteRetentionPolicy = shareDeleteRetentionPolicy; } - string fileServicesName = "default"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperationsExtensions.cs index e2bfc67583a68..0a5f74d13bd2d 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperationsExtensions.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/FileServicesOperationsExtensions.cs @@ -83,13 +83,18 @@ public static FileServiceItems List(this IFileServicesOperations operations, str /// Storage account names must be between 3 and 24 characters in length and use /// numbers and lower-case letters only. /// - /// - /// The properties of file services in storage accounts, including CORS - /// (Cross-Origin Resource Sharing) rules. + /// + /// Specifies CORS rules for the File service. You can include up to five + /// CorsRule elements in the request. If no CorsRule elements are included in + /// the request body, all CORS rules will be deleted, and CORS will be disabled + /// for the File service. + /// + /// + /// The file service properties for share soft delete. /// - public static FileServiceProperties SetServiceProperties(this IFileServicesOperations operations, string resourceGroupName, string accountName, FileServiceProperties parameters) + public static FileServiceProperties SetServiceProperties(this IFileServicesOperations operations, string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy)) { - return operations.SetServicePropertiesAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); + return operations.SetServicePropertiesAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy).GetAwaiter().GetResult(); } /// @@ -108,16 +113,21 @@ public static FileServiceProperties SetServiceProperties(this IFileServicesOpera /// Storage account names must be between 3 and 24 characters in length and use /// numbers and lower-case letters only. /// - /// - /// The properties of file services in storage accounts, including CORS - /// (Cross-Origin Resource Sharing) rules. + /// + /// Specifies CORS rules for the File service. You can include up to five + /// CorsRule elements in the request. If no CorsRule elements are included in + /// the request body, all CORS rules will be deleted, and CORS will be disabled + /// for the File service. + /// + /// + /// The file service properties for share soft delete. /// /// /// The cancellation token. /// - public static async Task SetServicePropertiesAsync(this IFileServicesOperations operations, string resourceGroupName, string accountName, FileServiceProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SetServicePropertiesAsync(this IFileServicesOperations operations, string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.SetServicePropertiesWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.SetServicePropertiesWithHttpMessagesAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobInventoryPoliciesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobInventoryPoliciesOperations.cs deleted file mode 100644 index 30c8d14b77eca..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobInventoryPoliciesOperations.cs +++ /dev/null @@ -1,145 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BlobInventoryPoliciesOperations operations. - /// - public partial interface IBlobInventoryPoliciesOperations - { - /// - /// Gets the blob inventory policy associated with the specified - /// storage account. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Sets the blob inventory policy to the specified storage account. - /// - /// - /// 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 storage account blob inventory policy object. It is composed of - /// policy rules. - /// - /// - /// - /// - /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BlobInventoryPolicySchema policy, SystemData systemData = default(SystemData), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the blob inventory policy associated with the specified - /// storage account. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the blob inventory policy associated with the specified - /// storage account. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IDeletedAccountsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IDeletedAccountsOperations.cs deleted file mode 100644 index c2717f6d0e132..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IDeletedAccountsOperations.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// DeletedAccountsOperations operations. - /// - public partial interface IDeletedAccountsOperations - { - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get properties of specified deleted account resource. - /// - /// - /// Name of the deleted storage account. - /// - /// - /// The location of the deleted storage account. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string deletedAccountName, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists deleted accounts under the subscription. - /// - /// - /// 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/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileServicesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileServicesOperations.cs index 3a293a1663174..ea32df99524a7 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileServicesOperations.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IFileServicesOperations.cs @@ -64,9 +64,14 @@ public partial interface IFileServicesOperations /// group. Storage account names must be between 3 and 24 characters in /// length and use numbers and lower-case letters only. /// - /// - /// The properties of file services in storage accounts, including CORS - /// (Cross-Origin Resource Sharing) rules. + /// + /// Specifies CORS rules for the File service. You can include up to + /// five CorsRule elements in the request. If no CorsRule elements are + /// included in the request body, all CORS rules will be deleted, and + /// CORS will be disabled for the File service. + /// + /// + /// The file service properties for share soft delete. /// /// /// The headers that will be added to request. @@ -83,7 +88,7 @@ public partial interface IFileServicesOperations /// /// Thrown when a required parameter is null /// - Task> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, FileServiceProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> SetServicePropertiesWithHttpMessagesAsync(string resourceGroupName, string accountName, CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the properties of file services in storage accounts, including /// CORS (Cross-Origin Resource Sharing) rules. 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/IStorageManagementClient.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageManagementClient.cs index 2a294e860c708..6b88c061b45a5 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageManagementClient.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageManagementClient.cs @@ -84,11 +84,6 @@ public partial interface IStorageManagementClient : System.IDisposable /// IStorageAccountsOperations StorageAccounts { get; } - /// - /// Gets the IDeletedAccountsOperations. - /// - IDeletedAccountsOperations DeletedAccounts { get; } - /// /// Gets the IUsagesOperations. /// @@ -99,11 +94,6 @@ public partial interface IStorageManagementClient : System.IDisposable /// IManagementPoliciesOperations ManagementPolicies { get; } - /// - /// Gets the IBlobInventoryPoliciesOperations. - /// - IBlobInventoryPoliciesOperations BlobInventoryPolicies { get; } - /// /// Gets the IPrivateEndpointConnectionsOperations. /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicy.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicy.cs deleted file mode 100644 index 7cf2a02bcc4a2..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicy.cs +++ /dev/null @@ -1,97 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The storage account blob inventory policy. - /// - [Rest.Serialization.JsonTransformation] - public partial class BlobInventoryPolicy : Resource - { - /// - /// Initializes a new instance of the BlobInventoryPolicy class. - /// - public BlobInventoryPolicy() - { - Policy = new BlobInventoryPolicySchema(); - CustomInit(); - } - - /// - /// Initializes a new instance of the BlobInventoryPolicy class. - /// - /// The storage account blob inventory policy - /// object. It is composed of policy rules. - /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Returns the last modified date and - /// time of the blob inventory policy. - public BlobInventoryPolicy(BlobInventoryPolicySchema policy, string id = default(string), string name = default(string), string type = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), SystemData systemData = default(SystemData)) - : base(id, name, type) - { - LastModifiedTime = lastModifiedTime; - Policy = policy; - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets returns the last modified date and time of the blob inventory - /// policy. - /// - [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } - - /// - /// Gets or sets the storage account blob inventory policy object. It - /// is composed of policy rules. - /// - [JsonProperty(PropertyName = "properties.policy")] - public BlobInventoryPolicySchema Policy { get; set; } - - /// - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Policy == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Policy"); - } - if (Policy != null) - { - Policy.Validate(); - } - } - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyDefinition.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyDefinition.cs deleted file mode 100644 index 22d355ba75039..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyDefinition.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// An object that defines the blob inventory rule. Each definition - /// consists of a set of filters. - /// - public partial class BlobInventoryPolicyDefinition - { - /// - /// Initializes a new instance of the BlobInventoryPolicyDefinition - /// class. - /// - public BlobInventoryPolicyDefinition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BlobInventoryPolicyDefinition - /// class. - /// - /// An object that defines the filter - /// set. - public BlobInventoryPolicyDefinition(BlobInventoryPolicyFilter filters) - { - Filters = filters; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets an object that defines the filter set. - /// - [JsonProperty(PropertyName = "filters")] - public BlobInventoryPolicyFilter Filters { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Filters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Filters"); - } - if (Filters != null) - { - Filters.Validate(); - } - } - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyFilter.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyFilter.cs deleted file mode 100644 index ac6d36550cba3..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyFilter.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An object that defines the blob inventory rule filter conditions. - /// - public partial class BlobInventoryPolicyFilter - { - /// - /// Initializes a new instance of the BlobInventoryPolicyFilter class. - /// - public BlobInventoryPolicyFilter() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BlobInventoryPolicyFilter class. - /// - /// An array of predefined enum values. Valid - /// values include blockBlob, appendBlob, pageBlob. Hns accounts does - /// not support pageBlobs. - /// An array of strings for blob prefixes to - /// be matched. - /// Includes blob versions in blob - /// inventory when value set to true. - /// Includes blob snapshots in blob - /// inventory when value set to true. - public BlobInventoryPolicyFilter(IList blobTypes, IList prefixMatch = default(IList), bool? includeBlobVersions = default(bool?), bool? includeSnapshots = default(bool?)) - { - PrefixMatch = prefixMatch; - BlobTypes = blobTypes; - IncludeBlobVersions = includeBlobVersions; - IncludeSnapshots = includeSnapshots; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets an array of strings for blob prefixes to be matched. - /// - [JsonProperty(PropertyName = "prefixMatch")] - public IList PrefixMatch { get; set; } - - /// - /// Gets or sets an array of predefined enum values. Valid values - /// include blockBlob, appendBlob, pageBlob. Hns accounts does not - /// support pageBlobs. - /// - [JsonProperty(PropertyName = "blobTypes")] - public IList BlobTypes { get; set; } - - /// - /// Gets or sets includes blob versions in blob inventory when value - /// set to true. - /// - [JsonProperty(PropertyName = "includeBlobVersions")] - public bool? IncludeBlobVersions { get; set; } - - /// - /// Gets or sets includes blob snapshots in blob inventory when value - /// set to true. - /// - [JsonProperty(PropertyName = "includeSnapshots")] - public bool? IncludeSnapshots { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (BlobTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "BlobTypes"); - } - } - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyRule.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyRule.cs deleted file mode 100644 index ea8a93faa67e6..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicyRule.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// An object that wraps the blob inventory rule. Each rule is uniquely - /// defined by name. - /// - public partial class BlobInventoryPolicyRule - { - /// - /// Initializes a new instance of the BlobInventoryPolicyRule class. - /// - public BlobInventoryPolicyRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BlobInventoryPolicyRule class. - /// - /// Rule is enabled when set to true. - /// A rule name can contain any combination of alpha - /// numeric characters. Rule name is case-sensitive. It must be unique - /// within a policy. - /// An object that defines the blob inventory - /// policy rule. - public BlobInventoryPolicyRule(bool enabled, string name, BlobInventoryPolicyDefinition definition) - { - Enabled = enabled; - Name = name; - Definition = definition; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets rule is enabled when set to true. - /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } - - /// - /// Gets or sets a rule name can contain any combination of alpha - /// numeric characters. Rule name is case-sensitive. It must be unique - /// within a policy. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets an object that defines the blob inventory policy rule. - /// - [JsonProperty(PropertyName = "definition")] - public BlobInventoryPolicyDefinition Definition { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Definition == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Definition"); - } - if (Definition != null) - { - Definition.Validate(); - } - } - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicySchema.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicySchema.cs deleted file mode 100644 index 1aece50732a51..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobInventoryPolicySchema.cs +++ /dev/null @@ -1,114 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The storage account blob inventory policy rules. - /// - public partial class BlobInventoryPolicySchema - { - /// - /// Initializes a new instance of the BlobInventoryPolicySchema class. - /// - public BlobInventoryPolicySchema() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BlobInventoryPolicySchema class. - /// - /// Policy is enabled if set to true. - /// Container name where blob inventory files - /// are stored. Must be pre-created. - /// The storage account blob inventory policy - /// rules. The rule is applied when it is enabled. - public BlobInventoryPolicySchema(bool enabled, string destination, IList rules) - { - Enabled = enabled; - Destination = destination; - Rules = rules; - CustomInit(); - } - /// - /// Static constructor for BlobInventoryPolicySchema class. - /// - static BlobInventoryPolicySchema() - { - Type = "Inventory"; - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets policy is enabled if set to true. - /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } - - /// - /// Gets or sets container name where blob inventory files are stored. - /// Must be pre-created. - /// - [JsonProperty(PropertyName = "destination")] - public string Destination { get; set; } - - /// - /// Gets or sets the storage account blob inventory policy rules. The - /// rule is applied when it is enabled. - /// - [JsonProperty(PropertyName = "rules")] - public IList Rules { get; set; } - - /// - /// The valid value is Inventory - /// - [JsonProperty(PropertyName = "type")] - public static string Type { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Destination == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Destination"); - } - if (Rules == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Rules"); - } - if (Rules != null) - { - foreach (var element in Rules) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobServiceProperties.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobServiceProperties.cs index 625a789c34ef8..660a9cb0f0c51 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobServiceProperties.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobServiceProperties.cs @@ -59,11 +59,8 @@ public BlobServiceProperties() /// restore policy. /// The blob service /// properties for container soft delete. - /// The blob service - /// property to configure last access time based tracking - /// policy. /// Sku name and tier. - public BlobServiceProperties(string id = default(string), string name = default(string), string type = default(string), CorsRules cors = default(CorsRules), string defaultServiceVersion = default(string), DeleteRetentionPolicy deleteRetentionPolicy = default(DeleteRetentionPolicy), bool? isVersioningEnabled = default(bool?), bool? automaticSnapshotPolicyEnabled = default(bool?), ChangeFeed changeFeed = default(ChangeFeed), RestorePolicyProperties restorePolicy = default(RestorePolicyProperties), DeleteRetentionPolicy containerDeleteRetentionPolicy = default(DeleteRetentionPolicy), LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy = default(LastAccessTimeTrackingPolicy), Sku sku = default(Sku)) + public BlobServiceProperties(string id = default(string), string name = default(string), string type = default(string), CorsRules cors = default(CorsRules), string defaultServiceVersion = default(string), DeleteRetentionPolicy deleteRetentionPolicy = default(DeleteRetentionPolicy), bool? isVersioningEnabled = default(bool?), bool? automaticSnapshotPolicyEnabled = default(bool?), ChangeFeed changeFeed = default(ChangeFeed), RestorePolicyProperties restorePolicy = default(RestorePolicyProperties), DeleteRetentionPolicy containerDeleteRetentionPolicy = default(DeleteRetentionPolicy), Sku sku = default(Sku)) : base(id, name, type) { Cors = cors; @@ -74,7 +71,6 @@ public BlobServiceProperties() ChangeFeed = changeFeed; RestorePolicy = restorePolicy; ContainerDeleteRetentionPolicy = containerDeleteRetentionPolicy; - LastAccessTimeTrackingPolicy = lastAccessTimeTrackingPolicy; Sku = sku; CustomInit(); } @@ -138,13 +134,6 @@ public BlobServiceProperties() [JsonProperty(PropertyName = "properties.containerDeleteRetentionPolicy")] public DeleteRetentionPolicy ContainerDeleteRetentionPolicy { get; set; } - /// - /// Gets or sets the blob service property to configure last access - /// time based tracking policy. - /// - [JsonProperty(PropertyName = "properties.lastAccessTimeTrackingPolicy")] - public LastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy { get; set; } - /// /// Gets sku name and tier. /// @@ -171,10 +160,6 @@ public virtual void Validate() { ContainerDeleteRetentionPolicy.Validate(); } - if (LastAccessTimeTrackingPolicy != null) - { - LastAccessTimeTrackingPolicy.Validate(); - } if (Sku != null) { Sku.Validate(); diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/CreatedByType.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/CreatedByType.cs deleted file mode 100644 index 460ef05448aeb..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/CreatedByType.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - - /// - /// Defines values for CreatedByType. - /// - public static class CreatedByType - { - public const string User = "User"; - public const string Application = "Application"; - public const string ManagedIdentity = "ManagedIdentity"; - public const string Key = "Key"; - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DateAfterModification.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DateAfterModification.cs index 4826c632c9e88..82129b959d571 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DateAfterModification.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DateAfterModification.cs @@ -32,13 +32,9 @@ public DateAfterModification() /// /// Value indicating the /// age in days after last modification - /// Value indicating - /// the age in days after last blob access. This property can only be - /// used in conjunction with last access time tracking policy - public DateAfterModification(double? daysAfterModificationGreaterThan = default(double?), double? daysAfterLastAccessTimeGreaterThan = default(double?)) + public DateAfterModification(double daysAfterModificationGreaterThan) { DaysAfterModificationGreaterThan = daysAfterModificationGreaterThan; - DaysAfterLastAccessTimeGreaterThan = daysAfterLastAccessTimeGreaterThan; CustomInit(); } @@ -52,15 +48,7 @@ public DateAfterModification() /// modification /// [JsonProperty(PropertyName = "daysAfterModificationGreaterThan")] - public double? DaysAfterModificationGreaterThan { get; set; } - - /// - /// Gets or sets value indicating the age in days after last blob - /// access. This property can only be used in conjunction with last - /// access time tracking policy - /// - [JsonProperty(PropertyName = "daysAfterLastAccessTimeGreaterThan")] - public double? DaysAfterLastAccessTimeGreaterThan { get; set; } + public double DaysAfterModificationGreaterThan { get; set; } /// /// Validate the object. @@ -70,27 +58,13 @@ public DateAfterModification() /// public virtual void Validate() { - if (DaysAfterModificationGreaterThan != null) + if (DaysAfterModificationGreaterThan < 0) { - if (DaysAfterModificationGreaterThan < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DaysAfterModificationGreaterThan", 0); - } - if (DaysAfterModificationGreaterThan % 1 != 0) - { - throw new ValidationException(ValidationRules.MultipleOf, "DaysAfterModificationGreaterThan", 1); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "DaysAfterModificationGreaterThan", 0); } - if (DaysAfterLastAccessTimeGreaterThan != null) + if (DaysAfterModificationGreaterThan % 1 != 0) { - if (DaysAfterLastAccessTimeGreaterThan < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DaysAfterLastAccessTimeGreaterThan", 0); - } - if (DaysAfterLastAccessTimeGreaterThan % 1 != 0) - { - throw new ValidationException(ValidationRules.MultipleOf, "DaysAfterLastAccessTimeGreaterThan", 1); - } + throw new ValidationException(ValidationRules.MultipleOf, "DaysAfterModificationGreaterThan", 1); } } } diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeleteRetentionPolicy.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeleteRetentionPolicy.cs index 26e5d6dc82084..b5f1c7ccb8c42 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeleteRetentionPolicy.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeleteRetentionPolicy.cs @@ -69,16 +69,13 @@ public DeleteRetentionPolicy() /// public virtual void Validate() { - if (Days != null) + if (Days > 365) { - if (Days > 365) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Days", 365); - } - if (Days < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Days", 1); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Days", 365); + } + if (Days < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Days", 1); } } } diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedAccount.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedAccount.cs deleted file mode 100644 index 525af5c9b3a2c..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/DeletedAccount.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Deleted storage account - /// - [Rest.Serialization.JsonTransformation] - public partial class DeletedAccount : ProxyResource - { - /// - /// Initializes a new instance of the DeletedAccount class. - /// - public DeletedAccount() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DeletedAccount class. - /// - /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Full resource id of the - /// original storage account. - /// Location of the deleted account. - /// Can be used to attempt recovering - /// this deleted account via PutStorageAccount API. - /// Creation time of the deleted - /// account. - /// Deletion time of the deleted - /// account. - public DeletedAccount(string id = default(string), string name = default(string), string type = default(string), string storageAccountResourceId = default(string), string location = default(string), string restoreReference = default(string), string creationTime = default(string), string deletionTime = default(string)) - : base(id, name, type) - { - StorageAccountResourceId = storageAccountResourceId; - Location = location; - RestoreReference = restoreReference; - CreationTime = creationTime; - DeletionTime = deletionTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets full resource id of the original storage account. - /// - [JsonProperty(PropertyName = "properties.storageAccountResourceId")] - public string StorageAccountResourceId { get; private set; } - - /// - /// Gets location of the deleted account. - /// - [JsonProperty(PropertyName = "properties.location")] - public string Location { get; private set; } - - /// - /// Gets can be used to attempt recovering this deleted account via - /// PutStorageAccount API. - /// - [JsonProperty(PropertyName = "properties.restoreReference")] - public string RestoreReference { get; private set; } - - /// - /// Gets creation time of the deleted account. - /// - [JsonProperty(PropertyName = "properties.creationTime")] - public string CreationTime { get; private set; } - - /// - /// Gets deletion time of the deleted account. - /// - [JsonProperty(PropertyName = "properties.deletionTime")] - public string DeletionTime { get; private set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponse.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponse.cs index ca76cd7d53df9..edfd44dfac6ad 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponse.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponse.cs @@ -29,11 +29,14 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Azure Storage Resource Provider error response - /// body. - public ErrorResponse(ErrorResponseBody error = default(ErrorResponseBody)) + /// An identifier for the error. Codes are invariant + /// and are intended to be consumed programmatically. + /// A message describing the error, intended to + /// be suitable for display in a user interface. + public ErrorResponse(string code = default(string), string message = default(string)) { - Error = error; + Code = code; + Message = message; CustomInit(); } @@ -43,10 +46,18 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets or sets azure Storage Resource Provider error response body. + /// Gets or sets an identifier for the error. Codes are invariant and + /// are intended to be consumed programmatically. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponseBody Error { get; set; } + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets a message describing the error, intended to be + /// suitable for display in a user interface. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } } } diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponseBody.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponseBody.cs deleted file mode 100644 index 5efef6b124495..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ErrorResponseBody.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error response body contract. - /// - public partial class ErrorResponseBody - { - /// - /// Initializes a new instance of the ErrorResponseBody class. - /// - public ErrorResponseBody() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponseBody class. - /// - /// An identifier for the error. Codes are invariant - /// and are intended to be consumed programmatically. - /// A message describing the error, intended to - /// be suitable for display in a user interface. - public ErrorResponseBody(string code = default(string), string message = default(string)) - { - Code = code; - Message = message; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets an identifier for the error. Codes are invariant and - /// are intended to be consumed programmatically. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets a message describing the error, intended to be - /// suitable for display in a user interface. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocation.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocation.cs deleted file mode 100644 index b86d33cc81f68..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocation.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The complex type of the extended location. - /// - public partial class ExtendedLocation - { - /// - /// Initializes a new instance of the ExtendedLocation class. - /// - public ExtendedLocation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExtendedLocation class. - /// - /// The name of the extended location. - /// The type of the extended location. Possible - /// values include: 'EdgeZone' - public ExtendedLocation(string name = default(string), string type = default(string)) - { - Name = name; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the extended location. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the type of the extended location. Possible values - /// include: 'EdgeZone' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocationTypes.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocationTypes.cs deleted file mode 100644 index 9b6bb7986ecad..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ExtendedLocationTypes.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - - /// - /// Defines values for ExtendedLocationTypes. - /// - public static class ExtendedLocationTypes - { - public const string EdgeZone = "EdgeZone"; - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileServiceProperties.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileServiceProperties.cs index 5fcfff6f79c47..0a826e11050be 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileServiceProperties.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/FileServiceProperties.cs @@ -45,15 +45,12 @@ public FileServiceProperties() /// service. /// The file service /// properties for share soft delete. - /// Protocol settings for file - /// service /// Sku name and tier. - public FileServiceProperties(string id = default(string), string name = default(string), string type = default(string), CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), ProtocolSettings protocolSettings = default(ProtocolSettings), Sku sku = default(Sku)) + public FileServiceProperties(string id = default(string), string name = default(string), string type = default(string), CorsRules cors = default(CorsRules), DeleteRetentionPolicy shareDeleteRetentionPolicy = default(DeleteRetentionPolicy), Sku sku = default(Sku)) : base(id, name, type) { Cors = cors; ShareDeleteRetentionPolicy = shareDeleteRetentionPolicy; - ProtocolSettings = protocolSettings; Sku = sku; CustomInit(); } @@ -78,12 +75,6 @@ public FileServiceProperties() [JsonProperty(PropertyName = "properties.shareDeleteRetentionPolicy")] public DeleteRetentionPolicy ShareDeleteRetentionPolicy { get; set; } - /// - /// Gets or sets protocol settings for file service - /// - [JsonProperty(PropertyName = "properties.protocolSettings")] - public ProtocolSettings ProtocolSettings { get; set; } - /// /// Gets sku name and tier. /// 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 3b60c08465b2f..a6bc9685641b3 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 @@ -195,16 +195,13 @@ public FileShare() /// public virtual void Validate() { - if (ShareQuota != null) + if (ShareQuota > 102400) { - if (ShareQuota > 102400) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ShareQuota", 102400); - } - if (ShareQuota < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ShareQuota", 1); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "ShareQuota", 102400); + } + if (ShareQuota < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ShareQuota", 1); } } } 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 1c900fe1caa0f..eb0cd4a987c58 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 @@ -194,16 +194,13 @@ public FileShareItem() /// public virtual void Validate() { - if (ShareQuota != null) + if (ShareQuota > 102400) { - if (ShareQuota > 102400) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ShareQuota", 102400); - } - if (ShareQuota < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ShareQuota", 1); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "ShareQuota", 102400); + } + if (ShareQuota < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ShareQuota", 1); } } } 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/LastAccessTimeTrackingPolicy.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/LastAccessTimeTrackingPolicy.cs deleted file mode 100644 index 73070a6d8e372..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/LastAccessTimeTrackingPolicy.cs +++ /dev/null @@ -1,102 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The blob service properties for Last access time based tracking policy. - /// - public partial class LastAccessTimeTrackingPolicy - { - /// - /// Initializes a new instance of the LastAccessTimeTrackingPolicy - /// class. - /// - public LastAccessTimeTrackingPolicy() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LastAccessTimeTrackingPolicy - /// class. - /// - /// When set to true last access time based - /// tracking is enabled. - /// Name of the policy. The valid value is - /// AccessTimeTracking. This field is currently read only. Possible - /// values include: 'AccessTimeTracking' - /// The field specifies blob - /// object tracking granularity in days, typically how often the blob - /// object should be tracked.This field is currently read only with - /// value as 1 - /// An array of predefined supported blob types. - /// Only blockBlob is the supported value. This field is currently read - /// only - public LastAccessTimeTrackingPolicy(bool enable, string name = default(string), int? trackingGranularityInDays = default(int?), IList blobType = default(IList)) - { - Enable = enable; - Name = name; - TrackingGranularityInDays = trackingGranularityInDays; - BlobType = blobType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets when set to true last access time based tracking is - /// enabled. - /// - [JsonProperty(PropertyName = "enable")] - public bool Enable { get; set; } - - /// - /// Gets or sets name of the policy. The valid value is - /// AccessTimeTracking. This field is currently read only. Possible - /// values include: 'AccessTimeTracking' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the field specifies blob object tracking granularity - /// in days, typically how often the blob object should be tracked.This - /// field is currently read only with value as 1 - /// - [JsonProperty(PropertyName = "trackingGranularityInDays")] - public int? TrackingGranularityInDays { get; set; } - - /// - /// Gets or sets an array of predefined supported blob types. Only - /// blockBlob is the supported value. This field is currently read only - /// - [JsonProperty(PropertyName = "blobType")] - public IList BlobType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ManagementPolicyBaseBlob.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ManagementPolicyBaseBlob.cs index 26ffafe829854..eb236e99b007c 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ManagementPolicyBaseBlob.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ManagementPolicyBaseBlob.cs @@ -34,16 +34,11 @@ public ManagementPolicyBaseBlob() /// The function to tier blobs to archive /// storage. Support blobs currently at Hot or Cool tier /// The function to delete the blob - /// This property enables - /// auto tiering of a blob from cool to hot on a blob access. This - /// property requires - /// tierToCool.daysAfterLastAccessTimeGreaterThan. - public ManagementPolicyBaseBlob(DateAfterModification tierToCool = default(DateAfterModification), DateAfterModification tierToArchive = default(DateAfterModification), DateAfterModification delete = default(DateAfterModification), bool? enableAutoTierToHotFromCool = default(bool?)) + public ManagementPolicyBaseBlob(DateAfterModification tierToCool = default(DateAfterModification), DateAfterModification tierToArchive = default(DateAfterModification), DateAfterModification delete = default(DateAfterModification)) { TierToCool = tierToCool; TierToArchive = tierToArchive; Delete = delete; - EnableAutoTierToHotFromCool = enableAutoTierToHotFromCool; CustomInit(); } @@ -72,14 +67,6 @@ public ManagementPolicyBaseBlob() [JsonProperty(PropertyName = "delete")] public DateAfterModification Delete { get; set; } - /// - /// Gets or sets this property enables auto tiering of a blob from cool - /// to hot on a blob access. This property requires - /// tierToCool.daysAfterLastAccessTimeGreaterThan. - /// - [JsonProperty(PropertyName = "enableAutoTierToHotFromCool")] - public bool? EnableAutoTierToHotFromCool { get; set; } - /// /// Validate the object. /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Multichannel.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Multichannel.cs deleted file mode 100644 index 56e31218ea5d5..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Multichannel.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Multichannel setting. Applies to Premium FileStorage only. - /// - public partial class Multichannel - { - /// - /// Initializes a new instance of the Multichannel class. - /// - public Multichannel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Multichannel class. - /// - /// Indicates whether multichannel is - /// enabled - public Multichannel(bool? enabled = default(bool?)) - { - Enabled = enabled; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets indicates whether multichannel is enabled - /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Name.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Name.cs deleted file mode 100644 index 575e0d236f3d2..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/Name.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - - /// - /// Defines values for Name. - /// - public static class Name - { - public const string AccessTimeTracking = "AccessTimeTracking"; - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/NetworkRuleSet.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/NetworkRuleSet.cs index 375c84dad2efa..591263f534a39 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/NetworkRuleSet.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/NetworkRuleSet.cs @@ -42,10 +42,9 @@ public NetworkRuleSet() /// Sets the virtual network /// rules /// Sets the IP ACL rules - public NetworkRuleSet(DefaultAction defaultAction, string bypass = default(string), IList resourceAccessRules = default(IList), IList virtualNetworkRules = default(IList), IList ipRules = default(IList)) + public NetworkRuleSet(DefaultAction defaultAction, string bypass = default(string), IList virtualNetworkRules = default(IList), IList ipRules = default(IList)) { Bypass = bypass; - ResourceAccessRules = resourceAccessRules; VirtualNetworkRules = virtualNetworkRules; IpRules = ipRules; DefaultAction = defaultAction; @@ -67,11 +66,6 @@ public NetworkRuleSet() [JsonProperty(PropertyName = "bypass")] public string Bypass { get; set; } - /// - /// - [JsonProperty(PropertyName = "resourceAccessRules")] - public IList ResourceAccessRules { get; set; } - /// /// Gets or sets sets the virtual network rules /// diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ProtocolSettings.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ProtocolSettings.cs deleted file mode 100644 index 61f4c15cffe1a..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ProtocolSettings.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Protocol settings for file service - /// - public partial class ProtocolSettings - { - /// - /// Initializes a new instance of the ProtocolSettings class. - /// - public ProtocolSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProtocolSettings class. - /// - /// Setting for SMB protocol - public ProtocolSettings(SmbSetting smb = default(SmbSetting)) - { - Smb = smb; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets setting for SMB protocol - /// - [JsonProperty(PropertyName = "smb")] - public SmbSetting Smb { get; set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ResourceAccessRule.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ResourceAccessRule.cs deleted file mode 100644 index a5acd9b09388f..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ResourceAccessRule.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Resource Access Rule. - /// - public partial class ResourceAccessRule - { - /// - /// Initializes a new instance of the ResourceAccessRule class. - /// - public ResourceAccessRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ResourceAccessRule class. - /// - /// Tenant Id - /// Resource Id - public ResourceAccessRule(string tenantId = default(string), string resourceId = default(string)) - { - TenantId = tenantId; - ResourceId = resourceId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets tenant Id - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets resource Id - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RestorePolicyProperties.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RestorePolicyProperties.cs index 8f6eef161321f..55a39da16715e 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RestorePolicyProperties.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/RestorePolicyProperties.cs @@ -86,16 +86,13 @@ public RestorePolicyProperties() /// public virtual void Validate() { - if (Days != null) + if (Days > 365) { - if (Days > 365) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Days", 365); - } - if (Days < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Days", 1); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Days", 365); + } + if (Days < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Days", 1); } } } 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/Models/SmbSetting.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SmbSetting.cs deleted file mode 100644 index aae5288c31648..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SmbSetting.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Setting for SMB protocol - /// - public partial class SmbSetting - { - /// - /// Initializes a new instance of the SmbSetting class. - /// - public SmbSetting() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SmbSetting class. - /// - /// Multichannel setting. Applies to Premium - /// FileStorage only. - public SmbSetting(Multichannel multichannel = default(Multichannel)) - { - Multichannel = multichannel; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets multichannel setting. Applies to Premium FileStorage - /// only. - /// - [JsonProperty(PropertyName = "multichannel")] - public Multichannel Multichannel { get; set; } - - } -} diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccount.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccount.cs index fb6134fc77a81..7afd5a2444a73 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccount.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccount.cs @@ -48,8 +48,6 @@ public StorageAccount() /// 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', /// 'BlockBlobStorage' /// The identity of the resource. - /// The extendedLocation of the - /// resource. /// Gets the status of the storage /// account at the time the operation was called. Possible values /// include: 'Creating', 'ResolvingDNS', 'Succeeded' @@ -114,13 +112,12 @@ public StorageAccount() /// permitted on requests to storage. The default interpretation is TLS /// 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', /// 'TLS1_2' - public StorageAccount(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), Identity identity = default(Identity), ExtendedLocation extendedLocation = default(ExtendedLocation), ProvisioningState? provisioningState = default(ProvisioningState?), Endpoints primaryEndpoints = default(Endpoints), string primaryLocation = default(string), AccountStatus? statusOfPrimary = default(AccountStatus?), System.DateTime? lastGeoFailoverTime = default(System.DateTime?), string secondaryLocation = default(string), AccountStatus? statusOfSecondary = default(AccountStatus?), System.DateTime? creationTime = default(System.DateTime?), CustomDomain customDomain = default(CustomDomain), Endpoints secondaryEndpoints = default(Endpoints), Encryption encryption = default(Encryption), AccessTier? accessTier = default(AccessTier?), AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication = default(AzureFilesIdentityBasedAuthentication), bool? enableHttpsTrafficOnly = default(bool?), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), bool? isHnsEnabled = default(bool?), GeoReplicationStats geoReplicationStats = default(GeoReplicationStats), bool? failoverInProgress = default(bool?), string largeFileSharesState = default(string), IList privateEndpointConnections = default(IList), RoutingPreference routingPreference = default(RoutingPreference), BlobRestoreStatus blobRestoreStatus = default(BlobRestoreStatus), bool? allowBlobPublicAccess = default(bool?), string minimumTlsVersion = default(string)) + public StorageAccount(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), Identity identity = default(Identity), ProvisioningState? provisioningState = default(ProvisioningState?), Endpoints primaryEndpoints = default(Endpoints), string primaryLocation = default(string), AccountStatus? statusOfPrimary = default(AccountStatus?), System.DateTime? lastGeoFailoverTime = default(System.DateTime?), string secondaryLocation = default(string), AccountStatus? statusOfSecondary = default(AccountStatus?), System.DateTime? creationTime = default(System.DateTime?), CustomDomain customDomain = default(CustomDomain), Endpoints secondaryEndpoints = default(Endpoints), Encryption encryption = default(Encryption), AccessTier? accessTier = default(AccessTier?), AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication = default(AzureFilesIdentityBasedAuthentication), bool? enableHttpsTrafficOnly = default(bool?), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), bool? isHnsEnabled = default(bool?), GeoReplicationStats geoReplicationStats = default(GeoReplicationStats), bool? failoverInProgress = default(bool?), string largeFileSharesState = default(string), IList privateEndpointConnections = default(IList), RoutingPreference routingPreference = default(RoutingPreference), BlobRestoreStatus blobRestoreStatus = default(BlobRestoreStatus), bool? allowBlobPublicAccess = default(bool?), string minimumTlsVersion = default(string)) : base(location, id, name, type, tags) { Sku = sku; Kind = kind; Identity = identity; - ExtendedLocation = extendedLocation; ProvisioningState = provisioningState; PrimaryEndpoints = primaryEndpoints; PrimaryLocation = primaryLocation; @@ -172,12 +169,6 @@ public StorageAccount() [JsonProperty(PropertyName = "identity")] public Identity Identity { get; set; } - /// - /// Gets or sets the extendedLocation of the resource. - /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - /// /// Gets the status of the storage account at the time the operation /// was called. Possible values include: 'Creating', 'ResolvingDNS', diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccountCreateParameters.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccountCreateParameters.cs index b799ead480a48..623f537b28b6c 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccountCreateParameters.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/StorageAccountCreateParameters.cs @@ -46,10 +46,6 @@ public StorageAccountCreateParameters() /// region of a resource cannot be changed once it is created, but if /// an identical geo region is specified on update, the request will /// succeed. - /// Optional. Set the extended location - /// of the resource. If not set, the storage account will be created in - /// Azure main region. Otherwise it will be created in the specified - /// extended location /// Gets or sets a list of key value pairs that /// describe the resource. These tags can be used for viewing and /// grouping this resource (across resource groups). A maximum of 15 @@ -87,12 +83,11 @@ public StorageAccountCreateParameters() /// permitted on requests to storage. The default interpretation is TLS /// 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', /// 'TLS1_2' - public StorageAccountCreateParameters(Sku sku, string kind, string location, ExtendedLocation extendedLocation = default(ExtendedLocation), IDictionary tags = default(IDictionary), Identity identity = default(Identity), CustomDomain customDomain = default(CustomDomain), Encryption encryption = default(Encryption), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), AccessTier? accessTier = default(AccessTier?), AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication = default(AzureFilesIdentityBasedAuthentication), bool? enableHttpsTrafficOnly = default(bool?), bool? isHnsEnabled = default(bool?), string largeFileSharesState = default(string), RoutingPreference routingPreference = default(RoutingPreference), bool? allowBlobPublicAccess = default(bool?), string minimumTlsVersion = default(string)) + public StorageAccountCreateParameters(Sku sku, string kind, string location, IDictionary tags = default(IDictionary), Identity identity = default(Identity), CustomDomain customDomain = default(CustomDomain), Encryption encryption = default(Encryption), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), AccessTier? accessTier = default(AccessTier?), AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication = default(AzureFilesIdentityBasedAuthentication), bool? enableHttpsTrafficOnly = default(bool?), bool? isHnsEnabled = default(bool?), string largeFileSharesState = default(string), RoutingPreference routingPreference = default(RoutingPreference), bool? allowBlobPublicAccess = default(bool?), string minimumTlsVersion = default(string)) { Sku = sku; Kind = kind; Location = location; - ExtendedLocation = extendedLocation; Tags = tags; Identity = identity; CustomDomain = customDomain; @@ -138,15 +133,6 @@ public StorageAccountCreateParameters() [JsonProperty(PropertyName = "location")] public string Location { get; set; } - /// - /// Gets or sets optional. Set the extended location of the resource. - /// If not set, the storage account will be created in Azure main - /// region. Otherwise it will be created in the specified extended - /// location - /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - /// /// Gets or sets a list of key value pairs that describe the resource. /// These tags can be used for viewing and grouping this resource diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SystemData.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SystemData.cs deleted file mode 100644 index 7f7d7fdcaa71d..0000000000000 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SystemData.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Storage.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Metadata pertaining to creation and last modification of the resource. - /// - public partial class SystemData - { - /// - /// Initializes a new instance of the SystemData class. - /// - public SystemData() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SystemData class. - /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The type of identity that last - /// modified the resource. - public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) - { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the identity that created the resource. - /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } - - /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' - /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } - - /// - /// Gets or sets the timestamp of resource creation (UTC). - /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } - - /// - /// Gets or sets the identity that last modified the resource. - /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } - - /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' - /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } - - /// - /// Gets or sets the type of identity that last modified the resource. - /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - - } -} 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 502cf3d0aead3..37b048624d8c5 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 @@ -19,38 +19,25 @@ public static IEnumerable> ApiInfo_StorageManageme { return new Tuple[] { - new Tuple("Storage", "BlobContainers", "2020-08-01-preview"), - new Tuple("Storage", "BlobInventoryPolicies", "2020-08-01-preview"), - new Tuple("Storage", "BlobServices", "2020-08-01-preview"), - new Tuple("Storage", "DeletedAccounts", "2020-08-01-preview"), - new Tuple("Storage", "EncryptionScopes", "2020-08-01-preview"), - new Tuple("Storage", "FileServices", "2020-08-01-preview"), - new Tuple("Storage", "FileShares", "2020-08-01-preview"), - new Tuple("Storage", "ManagementPolicies", "2020-08-01-preview"), - new Tuple("Storage", "ObjectReplicationPolicies", "2020-08-01-preview"), - new Tuple("Storage", "Operations", "2020-08-01-preview"), - new Tuple("Storage", "PrivateEndpointConnections", "2020-08-01-preview"), - new Tuple("Storage", "PrivateLinkResources", "2020-08-01-preview"), - new Tuple("Storage", "Queue", "2020-08-01-preview"), - new Tuple("Storage", "QueueServices", "2020-08-01-preview"), - new Tuple("Storage", "Skus", "2020-08-01-preview"), - new Tuple("Storage", "StorageAccounts", "2020-08-01-preview"), - new Tuple("Storage", "Table", "2020-08-01-preview"), - new Tuple("Storage", "TableServices", "2020-08-01-preview"), - new Tuple("Storage", "Usages", "2020-08-01-preview"), + new Tuple("Storage", "BlobContainers", "2019-06-01"), + new Tuple("Storage", "BlobServices", "2019-06-01"), + new Tuple("Storage", "EncryptionScopes", "2019-06-01"), + new Tuple("Storage", "FileServices", "2019-06-01"), + new Tuple("Storage", "FileShares", "2019-06-01"), + new Tuple("Storage", "ManagementPolicies", "2019-06-01"), + new Tuple("Storage", "ObjectReplicationPolicies", "2019-06-01"), + new Tuple("Storage", "Operations", "2019-06-01"), + new Tuple("Storage", "PrivateEndpointConnections", "2019-06-01"), + new Tuple("Storage", "PrivateLinkResources", "2019-06-01"), + new Tuple("Storage", "Queue", "2019-06-01"), + new Tuple("Storage", "QueueServices", "2019-06-01"), + new Tuple("Storage", "Skus", "2019-06-01"), + new Tuple("Storage", "StorageAccounts", "2019-06-01"), + new Tuple("Storage", "Table", "2019-06-01"), + new Tuple("Storage", "TableServices", "2019-06-01"), + new Tuple("Storage", "Usages", "2019-06-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/storage/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-08-preview --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 = "f11c7e7c36e28ca3b0d575cc4241c1e2a4099caa"; - 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 diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageManagementClient.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageManagementClient.cs index bd1d93c50e913..281fdd6768305 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageManagementClient.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageManagementClient.cs @@ -89,11 +89,6 @@ public partial class StorageManagementClient : ServiceClient public virtual IStorageAccountsOperations StorageAccounts { get; private set; } - /// - /// Gets the IDeletedAccountsOperations. - /// - public virtual IDeletedAccountsOperations DeletedAccounts { get; private set; } - /// /// Gets the IUsagesOperations. /// @@ -104,11 +99,6 @@ public partial class StorageManagementClient : ServiceClient public virtual IManagementPoliciesOperations ManagementPolicies { get; private set; } - /// - /// Gets the IBlobInventoryPoliciesOperations. - /// - public virtual IBlobInventoryPoliciesOperations BlobInventoryPolicies { get; private set; } - /// /// Gets the IPrivateEndpointConnectionsOperations. /// @@ -413,10 +403,8 @@ private void Initialize() Operations = new Operations(this); Skus = new SkusOperations(this); StorageAccounts = new StorageAccountsOperations(this); - DeletedAccounts = new DeletedAccountsOperations(this); Usages = new UsagesOperations(this); ManagementPolicies = new ManagementPoliciesOperations(this); - BlobInventoryPolicies = new BlobInventoryPoliciesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); PrivateLinkResources = new PrivateLinkResourcesOperations(this); ObjectReplicationPolicies = new ObjectReplicationPoliciesOperations(this); @@ -430,7 +418,7 @@ private void Initialize() TableServices = new TableServicesOperations(this); Table = new TableOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-08-01-preview"; + ApiVersion = "2019-06-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true;