Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </param>
/// <param name='immutabilityPeriodSinceCreationInDays'>
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='ifMatch'>
/// 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.
/// </param>
/// <param name='immutabilityPeriodSinceCreationInDays'>
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='allowProtectedAppendWrites'>
/// 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
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -2015,7 +2022,7 @@ internal BlobContainersOperations(StorageManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<ImmutabilityPolicy,BlobContainersCreateOrUpdateImmutabilityPolicyHeaders>> CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<ImmutabilityPolicy,BlobContainersCreateOrUpdateImmutabilityPolicyHeaders>> CreateOrUpdateImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch = default(string), int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -3190,6 +3201,13 @@ internal BlobContainersOperations(StorageManagementClient client)
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='allowProtectedAppendWrites'>
/// 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
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -3211,7 +3229,7 @@ internal BlobContainersOperations(StorageManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<ImmutabilityPolicy,BlobContainersExtendImmutabilityPolicyHeaders>> ExtendImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<ImmutabilityPolicy,BlobContainersExtendImmutabilityPolicyHeaders>> ExtendImmutabilityPolicyWithHttpMessagesAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, int? immutabilityPeriodSinceCreationInDays = default(int?), bool? allowProtectedAppendWrites = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </param>
/// <param name='immutabilityPeriodSinceCreationInDays'>
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='ifMatch'>
/// 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.
/// </param>
public static ImmutabilityPolicy CreateOrUpdateImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string))
/// <param name='immutabilityPeriodSinceCreationInDays'>
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='allowProtectedAppendWrites'>
/// 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
/// </param>
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();
}

/// <summary>
Expand All @@ -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.
/// </param>
/// <param name='immutabilityPeriodSinceCreationInDays'>
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='ifMatch'>
/// 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.
/// </param>
/// <param name='immutabilityPeriodSinceCreationInDays'>
/// The immutability period for the blobs in the container since the policy
/// creation, in days.
/// </param>
/// <param name='allowProtectedAppendWrites'>
/// 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
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ImmutabilityPolicy> CreateOrUpdateImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, int immutabilityPeriodSinceCreationInDays, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
public static async Task<ImmutabilityPolicy> 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;
}
Expand Down Expand Up @@ -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.
/// </param>
public static ImmutabilityPolicy ExtendImmutabilityPolicy(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays)
/// <param name='allowProtectedAppendWrites'>
/// 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
/// </param>
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();
}

/// <summary>
Expand Down Expand Up @@ -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.
/// </param>
/// <param name='allowProtectedAppendWrites'>
/// 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
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ImmutabilityPolicy> ExtendImmutabilityPolicyAsync(this IBlobContainersOperations operations, string resourceGroupName, string accountName, string containerName, string ifMatch, int immutabilityPeriodSinceCreationInDays, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<ImmutabilityPolicy> 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;
}
Expand Down
Loading