Пример #1
0
        private BucketsResource.LockRetentionPolicyRequest CreateLockBucketRetentionPolicyRequest(
            string bucket, long metageneration, LockBucketRetentionPolicyOptions options)
        {
            var request = Service.Buckets.LockRetentionPolicy(bucket, metageneration);

            options?.ModifyRequest(request);
            return(request);
        }
Пример #2
0
 /// <inheritdoc />
 public override Task LockBucketRetentionPolicyAsync(
     string bucket,
     long metageneration,
     LockBucketRetentionPolicyOptions options = null,
     CancellationToken cancellationToken      = default)
 {
     ValidateBucketName(bucket);
     return(CreateLockBucketRetentionPolicyRequest(bucket, metageneration, options).ExecuteAsync(cancellationToken));
 }
 /// <summary>
 /// Asynchronously locks the retention policy of a bucket. This is a one-way process:
 /// once a retention policy is locked, it cannot be shortened, removed or unlocked,
 /// although it can be increased in duration. The lock persists until the bucket is deleted.
 /// </summary>
 /// <param name="bucket">The name of the bucket whose retention policy should be locked. Must not be null.</param>
 /// <param name="metageneration">The current metageneration of the bucket, used to validate that the bucket version to be locked
 /// is the intended one.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public virtual Task LockBucketRetentionPolicyAsync(string bucket, long metageneration, LockBucketRetentionPolicyOptions options = null, CancellationToken cancellationToken = default) =>
 throw new NotImplementedException();
Пример #4
0
 /// <inheritdoc />
 public override void LockBucketRetentionPolicy(string bucket, long metageneration, LockBucketRetentionPolicyOptions options = null)
 {
     ValidateBucketName(bucket);
     CreateLockBucketRetentionPolicyRequest(bucket, metageneration, options).Execute();
 }
 /// <summary>
 /// Locks the retention policy of a bucket. This is a one-way process:
 /// once a retention policy is locked, it cannot be shortened, removed or unlocked,
 /// although it can be increased in duration. The lock persists until the bucket is deleted.
 /// </summary>
 /// <param name="bucket">The name of the bucket whose retention policy should be locked. Must not be null.</param>
 /// <param name="metageneration">The current metageneration of the bucket, used to validate that the bucket version to be locked
 /// is the intended one.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 public virtual void LockBucketRetentionPolicy(string bucket, long metageneration, LockBucketRetentionPolicyOptions options = null) =>
 throw new NotImplementedException();