private SetIamPolicyRequest CreateSetBucketIamPolicyRequest(string bucket, Policy policy, SetBucketIamPolicyOptions options)
        {
            ValidateBucketName(bucket);
            GaxPreconditions.CheckNotNull(policy, nameof(policy));
            var bucketEntity = new Bucket {
                Name = bucket
            };
            var request = Service.Buckets.SetIamPolicy(policy, bucket);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            return(request);
        }
 /// <inheritdoc />
 public override Task <Policy> SetBucketIamPolicyAsync(string bucket, Policy policy, SetBucketIamPolicyOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 CreateSetBucketIamPolicyRequest(bucket, policy, options).ExecuteAsync(cancellationToken);
Example #3
0
 /// <summary>
 /// Updates the IAM policy information about a bucket asynchronously.
 /// </summary>
 /// <param name="bucket">The name of the bucket. Must not be null.</param>
 /// <param name="policy">The new IAM policy for the bucket. Must not be null.</param>
 /// <param name="options">Additional options for the fetch operation. May be null, in which case appropriate
 /// defaults will be used.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation, with a result returning the
 /// <see cref="Policy"/> representation of the resulting storage bucket IAM policy.</returns>
 public virtual Task <Policy> SetBucketIamPolicyAsync(string bucket, Policy policy, SetBucketIamPolicyOptions options = null, CancellationToken cancellationToken = default)
 {
     throw new NotImplementedException();
 }
 /// <inheritdoc />
 public override Policy SetBucketIamPolicy(string bucket, Policy policy, SetBucketIamPolicyOptions options = null) =>
 CreateSetBucketIamPolicyRequest(bucket, policy, options).Execute();
Example #5
0
 /// <summary>
 /// Updates the IAM policy information about a bucket synchronously.
 /// </summary>
 /// <param name="bucket">The name of the bucket. Must not be null.</param>
 /// <param name="policy">The new IAM policy for the bucket. Must not be null.</param>
 /// <param name="options">Additional options for the operation. May be null, in which case appropriate
 /// defaults will be used.</param>
 /// <returns>The <see cref="Policy"/> representation of the resulting storage bucket IAM policy.</returns>
 public virtual Policy SetBucketIamPolicy(string bucket, Policy policy, SetBucketIamPolicyOptions options = null)
 {
     throw new NotImplementedException();
 }