diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperations.cs
index 5011f7d9da4c..2f8f69c1a816 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperations.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperations.cs
@@ -1985,15 +1985,22 @@ internal BlobContainersOperations(StorageManagementClient client)
/// numbers, lower-case letters and dash (-) only. Every dash (-) character
/// must be immediately preceded and followed by a letter or number.
///
- ///
- /// The immutability period for the blobs in the container since the policy
- /// creation, in days.
- ///
///
/// The entity state (ETag) version of the immutability policy to update. A
/// value of "*" can be used to apply the operation only if the immutability
/// policy already exists. If omitted, this operation will always be applied.
///
+ ///
+ /// The immutability period for the blobs in the container since the policy
+ /// creation, in days.
+ ///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob while
+ /// maintaining immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This property
+ /// cannot be changed with ExtendImmutabilityPolicy API
+ ///
///
/// Headers that will be added to request.
///
@@ -2015,7 +2022,7 @@ internal BlobContainersOperations(StorageManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch = default(string), int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -2090,8 +2097,12 @@ internal BlobContainersOperations(StorageManagementClient client)
}
string immutabilityPolicyName = "default";
ImmutabilityPolicy parameters = default(ImmutabilityPolicy);
- parameters = new ImmutabilityPolicy();
- parameters.ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
+ if (immutabilityPeriodSinceCreationInDays != null || allowProtectedAppendWrites != null)
+ {
+ parameters = new ImmutabilityPolicy();
+ parameters.ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
+ parameters.AllowProtectedAppendWrites = allowProtectedAppendWrites;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -3190,6 +3201,13 @@ internal BlobContainersOperations(StorageManagementClient client)
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob while
+ /// maintaining immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This property
+ /// cannot be changed with ExtendImmutabilityPolicy API
+ ///
///
/// Headers that will be added to request.
///
@@ -3211,7 +3229,7 @@ internal BlobContainersOperations(StorageManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ExtendImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> ExtendImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -3289,8 +3307,12 @@ internal BlobContainersOperations(StorageManagementClient client)
throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
}
ImmutabilityPolicy parameters = default(ImmutabilityPolicy);
- parameters = new ImmutabilityPolicy();
- parameters.ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
+ if (immutabilityPeriodSinceCreationInDays != null || allowProtectedAppendWrites != null)
+ {
+ parameters = new ImmutabilityPolicy();
+ parameters.ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
+ parameters.AllowProtectedAppendWrites = allowProtectedAppendWrites;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperationsExtensions.cs
index 001ff0edd825..b191ba837b8a 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperationsExtensions.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/BlobContainersOperationsExtensions.cs
@@ -516,18 +516,25 @@ public static LegalHold ClearLegalHold(this IBlobContainersOperations operations
/// numbers, lower-case letters and dash (-) only. Every dash (-) character
/// must be immediately preceded and followed by a letter or number.
///
- ///
- /// The immutability period for the blobs in the container since the policy
- /// creation, in days.
- ///
///
/// The entity state (ETag) version of the immutability policy to update. A
/// value of "*" can be used to apply the operation only if the immutability
/// policy already exists. If omitted, this operation will always be applied.
///
- public static ImmutabilityPolicy CreateOrUpdateImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string))
+ ///
+ /// The immutability period for the blobs in the container since the policy
+ /// creation, in days.
+ ///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob while
+ /// maintaining immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This property
+ /// cannot be changed with ExtendImmutabilityPolicy API
+ ///
+ public static ImmutabilityPolicy CreateOrUpdateImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch = default(string), int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?))
{
- return operations.CreateOrUpdateImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).GetAwaiter().GetResult();
}
///
@@ -552,21 +559,28 @@ public static LegalHold ClearLegalHold(this IBlobContainersOperations operations
/// numbers, lower-case letters and dash (-) only. Every dash (-) character
/// must be immediately preceded and followed by a letter or number.
///
- ///
- /// The immutability period for the blobs in the container since the policy
- /// creation, in days.
- ///
///
/// The entity state (ETag) version of the immutability policy to update. A
/// value of "*" can be used to apply the operation only if the immutability
/// policy already exists. If omitted, this operation will always be applied.
///
+ ///
+ /// The immutability period for the blobs in the container since the policy
+ /// creation, in days.
+ ///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob while
+ /// maintaining immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This property
+ /// cannot be changed with ExtendImmutabilityPolicy API
+ ///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch = default(string), int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -822,9 +836,16 @@ public static ImmutabilityPolicy LockImmutabilityPolicy(this IBlobContainersOper
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
///
- public static ImmutabilityPolicy ExtendImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays)
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob while
+ /// maintaining immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This property
+ /// cannot be changed with ExtendImmutabilityPolicy API
+ ///
+ public static ImmutabilityPolicy ExtendImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?))
{
- return operations.ExtendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).GetAwaiter().GetResult();
+ return operations.ExtendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).GetAwaiter().GetResult();
}
///
@@ -859,12 +880,19 @@ public static ImmutabilityPolicy ExtendImmutabilityPolicy(this IBlobContainersOp
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob while
+ /// maintaining immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This property
+ /// cannot be changed with ExtendImmutabilityPolicy API
+ ///
///
/// The cancellation token.
///
- public static async Task ExtendImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task ExtendImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ExtendImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ExtendImmutabilityPolicyWithHttpMessagesAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/EncryptionScopesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/EncryptionScopesOperations.cs
new file mode 100644
index 000000000000..7606c95b5653
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/EncryptionScopesOperations.cs
@@ -0,0 +1,1289 @@
+//
+// 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;
+
+ ///
+ /// EncryptionScopesOperations operations.
+ ///
+ internal partial class EncryptionScopesOperations : IServiceOperations, IEncryptionScopesOperations
+ {
+ ///
+ /// Initializes a new instance of the EncryptionScopesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal EncryptionScopesOperations(StorageManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the StorageManagementClient
+ ///
+ public StorageManagementClient Client { get; private set; }
+
+ ///
+ /// Synchronously creates or updates an encryption scope under the specified
+ /// storage account. If an encryption scope is already created and a subsequent
+ /// request is issued with different properties, the encryption scope
+ /// properties will be updated per the specified request.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the create or update.
+ ///
+ ///
+ /// 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> PutWithHttpMessagesAsync(string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope, 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 (encryptionScopeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "encryptionScopeName");
+ }
+ if (encryptionScopeName != null)
+ {
+ if (encryptionScopeName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "encryptionScopeName", 63);
+ }
+ if (encryptionScopeName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "encryptionScopeName", 3);
+ }
+ }
+ if (encryptionScope == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "encryptionScope");
+ }
+ // 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("encryptionScopeName", encryptionScopeName);
+ tracingParameters.Add("encryptionScope", encryptionScope);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Put", 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}/encryptionScopes/{encryptionScopeName}").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("{encryptionScopeName}", System.Uri.EscapeDataString(encryptionScopeName));
+ 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(encryptionScope != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(encryptionScope, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ 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);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Update encryption scope properties as specified in the request body. Update
+ /// fails if the specified encryption scope does not already exist.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the update.
+ ///
+ ///
+ /// 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> PatchWithHttpMessagesAsync(string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope, 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 (encryptionScopeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "encryptionScopeName");
+ }
+ if (encryptionScopeName != null)
+ {
+ if (encryptionScopeName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "encryptionScopeName", 63);
+ }
+ if (encryptionScopeName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "encryptionScopeName", 3);
+ }
+ }
+ if (encryptionScope == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "encryptionScope");
+ }
+ // 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("encryptionScopeName", encryptionScopeName);
+ tracingParameters.Add("encryptionScope", encryptionScope);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Patch", 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}/encryptionScopes/{encryptionScopeName}").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("{encryptionScopeName}", System.Uri.EscapeDataString(encryptionScopeName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(encryptionScope != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(encryptionScope, 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;
+ }
+
+ ///
+ /// Returns the properties for the specified encryption scope.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string encryptionScopeName, 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 (encryptionScopeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "encryptionScopeName");
+ }
+ if (encryptionScopeName != null)
+ {
+ if (encryptionScopeName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "encryptionScopeName", 63);
+ }
+ if (encryptionScopeName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "encryptionScopeName", 3);
+ }
+ }
+ // 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("encryptionScopeName", encryptionScopeName);
+ 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}/encryptionScopes/{encryptionScopeName}").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("{encryptionScopeName}", System.Uri.EscapeDataString(encryptionScopeName));
+ 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 all the encryption scopes available under 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}/encryptionScopes").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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists all the encryption scopes available under the specified storage
+ /// account.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/EncryptionScopesOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/EncryptionScopesOperationsExtensions.cs
new file mode 100644
index 000000000000..b4f1d5950ff0
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/EncryptionScopesOperationsExtensions.cs
@@ -0,0 +1,303 @@
+//
+// 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 EncryptionScopesOperations.
+ ///
+ public static partial class EncryptionScopesOperationsExtensions
+ {
+ ///
+ /// Synchronously creates or updates an encryption scope under the specified
+ /// storage account. If an encryption scope is already created and a subsequent
+ /// request is issued with different properties, the encryption scope
+ /// properties will be updated per the specified request.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the create or update.
+ ///
+ public static EncryptionScope Put(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope)
+ {
+ return operations.PutAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Synchronously creates or updates an encryption scope under the specified
+ /// storage account. If an encryption scope is already created and a subsequent
+ /// request is issued with different properties, the encryption scope
+ /// properties will be updated per the specified request.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the create or update.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task PutAsync(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Update encryption scope properties as specified in the request body. Update
+ /// fails if the specified encryption scope does not already exist.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the update.
+ ///
+ public static EncryptionScope Patch(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope)
+ {
+ return operations.PatchAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update encryption scope properties as specified in the request body. Update
+ /// fails if the specified encryption scope does not already exist.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the update.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task PatchAsync(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Returns the properties for the specified encryption scope.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ public static EncryptionScope Get(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, string encryptionScopeName)
+ {
+ return operations.GetAsync(resourceGroupName, accountName, encryptionScopeName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Returns the properties for the specified encryption scope.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource group.
+ /// Storage account names must be between 3 and 24 characters in length and use
+ /// numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage account.
+ /// Encryption scope names must be between 3 and 63 characters in length and
+ /// use numbers, lower-case letters and dash (-) only. Every dash (-) character
+ /// must be immediately preceded and followed by a letter or number.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName, string encryptionScopeName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, encryptionScopeName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all the encryption scopes available under 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 IPage List(this IEncryptionScopesOperations operations, string resourceGroupName, string accountName)
+ {
+ return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all the encryption scopes available under 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 IEncryptionScopesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all the encryption scopes available under the specified storage
+ /// account.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IEncryptionScopesOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all the encryption scopes available under the specified storage
+ /// account.
+ ///
+ ///
+ /// 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 IEncryptionScopesOperations 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/IBlobContainersOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobContainersOperations.cs
index 8286235fa6e9..3a0ca56a9aa4 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobContainersOperations.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IBlobContainersOperations.cs
@@ -320,16 +320,24 @@ public partial interface IBlobContainersOperations
/// Every dash (-) character must be immediately preceded and followed
/// by a letter or number.
///
- ///
- /// The immutability period for the blobs in the container since the
- /// policy creation, in days.
- ///
///
/// The entity state (ETag) version of the immutability policy to
/// update. A value of "*" can be used to apply the operation only if
/// the immutability policy already exists. If omitted, this operation
/// will always be applied.
///
+ ///
+ /// The immutability period for the blobs in the container since the
+ /// policy creation, in days.
+ ///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob
+ /// while maintaining immutability protection and compliance. Only new
+ /// blocks can be added and any existing blocks cannot be modified or
+ /// deleted. This property cannot be changed with
+ /// ExtendImmutabilityPolicy API
+ ///
///
/// The headers that will be added to request.
///
@@ -345,7 +353,7 @@ public partial interface IBlobContainersOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch = default(string), int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Gets the existing immutability policy along with the corresponding
/// ETag in response headers and body.
@@ -507,6 +515,14 @@ public partial interface IBlobContainersOperations
/// The immutability period for the blobs in the container since the
/// policy creation, in days.
///
+ ///
+ /// This property can only be changed for unlocked time-based retention
+ /// policies. When enabled, new blocks can be written to an append blob
+ /// while maintaining immutability protection and compliance. Only new
+ /// blocks can be added and any existing blocks cannot be modified or
+ /// deleted. This property cannot be changed with
+ /// ExtendImmutabilityPolicy API
+ ///
///
/// The headers that will be added to request.
///
@@ -522,7 +538,7 @@ public partial interface IBlobContainersOperations
///
/// Thrown when a required parameter is null
///
- Task> ExtendImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> ExtendImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// The Lease Container operation establishes and manages a lock on a
/// container for delete operations. The lock duration can be 15 to 60
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IEncryptionScopesOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IEncryptionScopesOperations.cs
new file mode 100644
index 000000000000..6a6ee3a0a8f9
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IEncryptionScopesOperations.cs
@@ -0,0 +1,196 @@
+//
+// 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;
+
+ ///
+ /// EncryptionScopesOperations operations.
+ ///
+ public partial interface IEncryptionScopesOperations
+ {
+ ///
+ /// Synchronously creates or updates an encryption scope under the
+ /// specified storage account. If an encryption scope is already
+ /// created and a subsequent request is issued with different
+ /// properties, the encryption scope properties will be updated per the
+ /// specified request.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The
+ /// name is case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource
+ /// group. Storage account names must be between 3 and 24 characters in
+ /// length and use numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage
+ /// account. Encryption scope names must be between 3 and 63 characters
+ /// in length and use numbers, lower-case letters and dash (-) only.
+ /// Every dash (-) character must be immediately preceded and followed
+ /// by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the create or update.
+ ///
+ ///
+ /// 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> PutWithHttpMessagesAsync(string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update encryption scope properties as specified in the request
+ /// body. Update fails if the specified encryption scope does not
+ /// already exist.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The
+ /// name is case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource
+ /// group. Storage account names must be between 3 and 24 characters in
+ /// length and use numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage
+ /// account. Encryption scope names must be between 3 and 63 characters
+ /// in length and use numbers, lower-case letters and dash (-) only.
+ /// Every dash (-) character must be immediately preceded and followed
+ /// by a letter or number.
+ ///
+ ///
+ /// Encryption scope properties to be used for the update.
+ ///
+ ///
+ /// 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> PatchWithHttpMessagesAsync(string resourceGroupName, string accountName, string encryptionScopeName, EncryptionScope encryptionScope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns the properties for the specified encryption scope.
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The
+ /// name is case insensitive.
+ ///
+ ///
+ /// The name of the storage account within the specified resource
+ /// group. Storage account names must be between 3 and 24 characters in
+ /// length and use numbers and lower-case letters only.
+ ///
+ ///
+ /// The name of the encryption scope within the specified storage
+ /// account. Encryption scope names must be between 3 and 63 characters
+ /// in length and use numbers, lower-case letters and dash (-) only.
+ /// Every dash (-) character must be immediately preceded and followed
+ /// by a letter or number.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string encryptionScopeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all the encryption scopes available under 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));
+ ///
+ /// Lists all the encryption scopes available under the specified
+ /// storage account.
+ ///
+ ///
+ /// 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/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 c65c2982e950..0de470e88e4e 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageManagementClient.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageManagementClient.cs
@@ -104,6 +104,11 @@ public partial interface IStorageManagementClient : System.IDisposable
///
IPrivateLinkResourcesOperations PrivateLinkResources { get; }
+ ///
+ /// Gets the IEncryptionScopesOperations.
+ ///
+ IEncryptionScopesOperations EncryptionScopes { get; }
+
///
/// Gets the IBlobServicesOperations.
///
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobContainer.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobContainer.cs
index 91a3e130b95d..3a1d65dd81af 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobContainer.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/BlobContainer.cs
@@ -166,18 +166,5 @@ public BlobContainer()
[JsonProperty(PropertyName = "properties.hasImmutabilityPolicy")]
public bool? HasImmutabilityPolicy { get; private set; }
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (ImmutabilityPolicy != null)
- {
- ImmutabilityPolicy.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 4481c5f46501..c642b11befea 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
@@ -49,19 +49,22 @@ public BlobServiceProperties()
/// include version 2008-10-27 and all more recent versions.
/// The blob service properties for
/// blob soft delete.
- /// Automatic Snapshot is
- /// enabled if set to true.
+ /// Versioning is enabled if set to
+ /// true.
+ /// Deprecated in favor of
+ /// isVersioningEnabled property.
/// The blob service properties for change
/// feed events.
/// The blob service properties for blob
/// restore 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? automaticSnapshotPolicyEnabled = default(bool?), ChangeFeed changeFeed = default(ChangeFeed), RestorePolicyProperties restorePolicy = default(RestorePolicyProperties), 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), Sku sku = default(Sku))
: base(id, name, type)
{
Cors = cors;
DefaultServiceVersion = defaultServiceVersion;
DeleteRetentionPolicy = deleteRetentionPolicy;
+ IsVersioningEnabled = isVersioningEnabled;
AutomaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled;
ChangeFeed = changeFeed;
RestorePolicy = restorePolicy;
@@ -99,7 +102,13 @@ public BlobServiceProperties()
public DeleteRetentionPolicy DeleteRetentionPolicy { get; set; }
///
- /// Gets or sets automatic Snapshot is enabled if set to true.
+ /// Gets or sets versioning is enabled if set to true.
+ ///
+ [JsonProperty(PropertyName = "properties.isVersioningEnabled")]
+ public bool? IsVersioningEnabled { get; set; }
+
+ ///
+ /// Gets or sets deprecated in favor of isVersioningEnabled property.
///
[JsonProperty(PropertyName = "properties.automaticSnapshotPolicyEnabled")]
public bool? AutomaticSnapshotPolicyEnabled { get; set; }
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScope.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScope.cs
new file mode 100644
index 000000000000..f47df7605f4c
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScope.cs
@@ -0,0 +1,109 @@
+//
+// 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 Encryption Scope resource.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class EncryptionScope : Resource
+ {
+ ///
+ /// Initializes a new instance of the EncryptionScope class.
+ ///
+ public EncryptionScope()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the EncryptionScope 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. Ex-
+ /// Microsoft.Compute/virtualMachines or
+ /// Microsoft.Storage/storageAccounts.
+ /// The provider for the encryption scope.
+ /// Possible values (case-insensitive): Microsoft.Storage,
+ /// Microsoft.KeyVault. Possible values include: 'Microsoft.Storage',
+ /// 'Microsoft.KeyVault'
+ /// The state of the encryption scope. Possible
+ /// values (case-insensitive): Enabled, Disabled. Possible values
+ /// include: 'Enabled', 'Disabled'
+ /// Gets the creation date and time of the
+ /// encryption scope in UTC.
+ /// Gets the last modification date and
+ /// time of the encryption scope in UTC.
+ /// The key vault properties for the
+ /// encryption scope. This is a required field if encryption scope
+ /// 'source' attribute is set to 'Microsoft.KeyVault'.
+ public EncryptionScope(string id = default(string), string name = default(string), string type = default(string), string source = default(string), string state = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), EncryptionScopeKeyVaultProperties keyVaultProperties = default(EncryptionScopeKeyVaultProperties))
+ : base(id, name, type)
+ {
+ Source = source;
+ State = state;
+ CreationTime = creationTime;
+ LastModifiedTime = lastModifiedTime;
+ KeyVaultProperties = keyVaultProperties;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the provider for the encryption scope. Possible values
+ /// (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.
+ /// Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault'
+ ///
+ [JsonProperty(PropertyName = "properties.source")]
+ public string Source { get; set; }
+
+ ///
+ /// Gets or sets the state of the encryption scope. Possible values
+ /// (case-insensitive): Enabled, Disabled. Possible values include:
+ /// 'Enabled', 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "properties.state")]
+ public string State { get; set; }
+
+ ///
+ /// Gets the creation date and time of the encryption scope in UTC.
+ ///
+ [JsonProperty(PropertyName = "properties.creationTime")]
+ public System.DateTime? CreationTime { get; private set; }
+
+ ///
+ /// Gets the last modification date and time of the encryption scope in
+ /// UTC.
+ ///
+ [JsonProperty(PropertyName = "properties.lastModifiedTime")]
+ public System.DateTime? LastModifiedTime { get; private set; }
+
+ ///
+ /// Gets or sets the key vault properties for the encryption scope.
+ /// This is a required field if encryption scope 'source' attribute is
+ /// set to 'Microsoft.KeyVault'.
+ ///
+ [JsonProperty(PropertyName = "properties.keyVaultProperties")]
+ public EncryptionScopeKeyVaultProperties KeyVaultProperties { get; set; }
+
+ }
+}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeKeyVaultProperties.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeKeyVaultProperties.cs
new file mode 100644
index 000000000000..3f17962db5d7
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeKeyVaultProperties.cs
@@ -0,0 +1,61 @@
+//
+// 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 key vault properties for the encryption scope. This is a required
+ /// field if encryption scope 'source' attribute is set to
+ /// 'Microsoft.KeyVault'.
+ ///
+ public partial class EncryptionScopeKeyVaultProperties
+ {
+ ///
+ /// Initializes a new instance of the EncryptionScopeKeyVaultProperties
+ /// class.
+ ///
+ public EncryptionScopeKeyVaultProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the EncryptionScopeKeyVaultProperties
+ /// class.
+ ///
+ /// The object identifier for a key vault key
+ /// object. When applied, the encryption scope will use the key
+ /// referenced by the identifier to enable customer-managed key support
+ /// on this encryption scope.
+ public EncryptionScopeKeyVaultProperties(string keyUri = default(string))
+ {
+ KeyUri = keyUri;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the object identifier for a key vault key object. When
+ /// applied, the encryption scope will use the key referenced by the
+ /// identifier to enable customer-managed key support on this
+ /// encryption scope.
+ ///
+ [JsonProperty(PropertyName = "keyUri")]
+ public string KeyUri { get; set; }
+
+ }
+}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeSource.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeSource.cs
new file mode 100644
index 000000000000..114bca5423bf
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeSource.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Storage.Models
+{
+
+ ///
+ /// Defines values for EncryptionScopeSource.
+ ///
+ public static class EncryptionScopeSource
+ {
+ public const string MicrosoftStorage = "Microsoft.Storage";
+ public const string MicrosoftKeyVault = "Microsoft.KeyVault";
+ }
+}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeState.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeState.cs
new file mode 100644
index 000000000000..52a6b70e3d33
--- /dev/null
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/EncryptionScopeState.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Storage.Models
+{
+
+ ///
+ /// Defines values for EncryptionScopeState.
+ ///
+ public static class EncryptionScopeState
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
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/ImmutabilityPolicy.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicy.cs
index 14ff173945d8..9bdac4884b63 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicy.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicy.cs
@@ -33,9 +33,6 @@ public ImmutabilityPolicy()
///
/// Initializes a new instance of the ImmutabilityPolicy class.
///
- /// The
- /// immutability period for the blobs in the container since the policy
- /// creation, in days.
/// Fully qualified resource Id for the resource. Ex -
/// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
/// The name of the resource
@@ -43,14 +40,25 @@ public ImmutabilityPolicy()
/// Microsoft.Compute/virtualMachines or
/// Microsoft.Storage/storageAccounts.
/// Resource Etag.
+ /// The
+ /// immutability period for the blobs in the container since the policy
+ /// creation, in days.
/// The ImmutabilityPolicy state of a blob
/// container, possible values include: Locked and Unlocked. Possible
/// values include: 'Locked', 'Unlocked'
- public ImmutabilityPolicy(int immutabilityPeriodSinceCreationInDays, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string state = default(string))
+ /// This property can only be
+ /// changed for unlocked time-based retention policies. When enabled,
+ /// new blocks can be written to an append blob while maintaining
+ /// immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This
+ /// property cannot be changed with ExtendImmutabilityPolicy
+ /// API
+ public ImmutabilityPolicy(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), int? immutabilityPeriodSinceCreationInDays = default(int?), string state = default(string), bool? allowProtectedAppendWrites = default(bool?))
: base(id, name, type, etag)
{
ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
State = state;
+ AllowProtectedAppendWrites = allowProtectedAppendWrites;
CustomInit();
}
@@ -64,7 +72,7 @@ public ImmutabilityPolicy()
/// since the policy creation, in days.
///
[JsonProperty(PropertyName = "properties.immutabilityPeriodSinceCreationInDays")]
- public int ImmutabilityPeriodSinceCreationInDays { get; set; }
+ public int? ImmutabilityPeriodSinceCreationInDays { get; set; }
///
/// Gets the ImmutabilityPolicy state of a blob container, possible
@@ -75,13 +83,15 @@ public ImmutabilityPolicy()
public string State { get; private set; }
///
- /// Validate the object.
+ /// Gets or sets this property can only be changed for unlocked
+ /// time-based retention policies. When enabled, new blocks can be
+ /// written to an append blob while maintaining immutability protection
+ /// and compliance. Only new blocks can be added and any existing
+ /// blocks cannot be modified or deleted. This property cannot be
+ /// changed with ExtendImmutabilityPolicy API
///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- }
+ [JsonProperty(PropertyName = "properties.allowProtectedAppendWrites")]
+ public bool? AllowProtectedAppendWrites { get; set; }
+
}
}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicyProperties.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicyProperties.cs
index 512d866a8a8f..7e111564e884 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicyProperties.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ImmutabilityPolicyProperties.cs
@@ -42,13 +42,21 @@ public ImmutabilityPolicyProperties()
/// The ImmutabilityPolicy state of a blob
/// container, possible values include: Locked and Unlocked. Possible
/// values include: 'Locked', 'Unlocked'
+ /// This property can only be
+ /// changed for unlocked time-based retention policies. When enabled,
+ /// new blocks can be written to an append blob while maintaining
+ /// immutability protection and compliance. Only new blocks can be
+ /// added and any existing blocks cannot be modified or deleted. This
+ /// property cannot be changed with ExtendImmutabilityPolicy
+ /// API
/// ImmutabilityPolicy Etag.
/// The ImmutabilityPolicy update history
/// of the blob container.
- public ImmutabilityPolicyProperties(int immutabilityPeriodSinceCreationInDays, string state = default(string), string etag = default(string), IList updateHistory = default(IList))
+ public ImmutabilityPolicyProperties(int? immutabilityPeriodSinceCreationInDays = default(int?), string state = default(string), bool? allowProtectedAppendWrites = default(bool?), string etag = default(string), IList updateHistory = default(IList))
{
ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
State = state;
+ AllowProtectedAppendWrites = allowProtectedAppendWrites;
Etag = etag;
UpdateHistory = updateHistory;
CustomInit();
@@ -64,7 +72,7 @@ public ImmutabilityPolicyProperties()
/// since the policy creation, in days.
///
[JsonProperty(PropertyName = "properties.immutabilityPeriodSinceCreationInDays")]
- public int ImmutabilityPeriodSinceCreationInDays { get; set; }
+ public int? ImmutabilityPeriodSinceCreationInDays { get; set; }
///
/// Gets the ImmutabilityPolicy state of a blob container, possible
@@ -74,6 +82,17 @@ public ImmutabilityPolicyProperties()
[JsonProperty(PropertyName = "properties.state")]
public string State { get; private set; }
+ ///
+ /// Gets or sets this property can only be changed for unlocked
+ /// time-based retention policies. When enabled, new blocks can be
+ /// written to an append blob while maintaining immutability protection
+ /// and compliance. Only new blocks can be added and any existing
+ /// blocks cannot be modified or deleted. This property cannot be
+ /// changed with ExtendImmutabilityPolicy API
+ ///
+ [JsonProperty(PropertyName = "properties.allowProtectedAppendWrites")]
+ public bool? AllowProtectedAppendWrites { get; set; }
+
///
/// Gets immutabilityPolicy Etag.
///
@@ -86,14 +105,5 @@ public ImmutabilityPolicyProperties()
[JsonProperty(PropertyName = "updateHistory")]
public IList UpdateHistory { get; private set; }
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- }
}
}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListContainerItem.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListContainerItem.cs
index 6fc4856e4eb9..e303b4648b56 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListContainerItem.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/ListContainerItem.cs
@@ -165,18 +165,5 @@ public ListContainerItem()
[JsonProperty(PropertyName = "properties.hasImmutabilityPolicy")]
public bool? HasImmutabilityPolicy { get; private set; }
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (ImmutabilityPolicy != null)
- {
- ImmutabilityPolicy.Validate();
- }
- }
}
}
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/signedResource.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SignedResource.cs
similarity index 100%
rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/signedResource.cs
rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SignedResource.cs
diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs
index 6ad9d9f23c39..d7e4d5f18c77 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
@@ -21,6 +21,7 @@ public static IEnumerable> ApiInfo_StorageManageme
{
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"),
@@ -33,16 +34,5 @@ public static IEnumerable> ApiInfo_StorageManageme
}.AsEnumerable();
}
}
- // BEGIN: Code Generation Metadata Section
- public static readonly String AutoRestVersion = "latest";
- 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=latest --reflect-api-versions --csharp.output-folder=C:\\code\\srpsdk\\sdk\\storage\\Microsoft.Azure.Management.Storage\\src\\Generated";
- public static readonly String GithubForkName = "Azure";
- public static readonly String GithubBranchName = "master";
- public static readonly String GithubCommidId = "1840a3849622fcd715717b08186839b93fc40483";
- 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 38e6f8977ec1..2aed2cff622c 100644
--- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageManagementClient.cs
+++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageManagementClient.cs
@@ -109,6 +109,11 @@ public partial class StorageManagementClient : ServiceClient
public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; }
+ ///
+ /// Gets the IEncryptionScopesOperations.
+ ///
+ public virtual IEncryptionScopesOperations EncryptionScopes { get; private set; }
+
///
/// Gets the IBlobServicesOperations.
///
@@ -377,6 +382,7 @@ private void Initialize()
ManagementPolicies = new ManagementPoliciesOperations(this);
PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this);
PrivateLinkResources = new PrivateLinkResourcesOperations(this);
+ EncryptionScopes = new EncryptionScopesOperations(this);
BlobServices = new BlobServicesOperations(this);
BlobContainers = new BlobContainersOperations(this);
FileServices = new FileServicesOperations(this);