Esempio n. 1
0
 /// <summary>
 /// Updates the metadata for a storage bucket synchronously.
 /// </summary>
 /// <remarks>
 /// As this is a full update, <paramref name="bucket"/> must be fully populated. This is typically
 /// obtained by performing another operation (such as <see cref="GetBucket(string, GetBucketOptions)"/>
 /// with a "full" projection, and then modifying the returned object.
 /// </remarks>
 /// <param name="bucket">Bucket to update. Must not be null, and must have populated <c>Name</c>,
 /// <c>Bucket</c> and <c>Acl</c> properties.</param>
 /// <param name="options">Additional options for the update. May be null, in which case appropriate
 /// defaults will be used.</param>
 /// <returns>The <see cref="Bucket"/> representation of the updated storage bucket.</returns>
 public virtual Bucket UpdateBucket(
     Bucket bucket,
     UpdateBucketOptions options = null)
 {
     throw new NotImplementedException();
 }
        private BucketsResource.UpdateRequest CreateUpdateBucketRequest(Bucket bucket, UpdateBucketOptions options)
        {
            ValidateBucket(bucket, nameof(bucket));
            GaxRestPreconditions.CheckArgument(bucket.Acl != null, nameof(bucket), "The Acl property of the bucket to update is null");
            var request = Service.Buckets.Update(bucket, bucket.Name);

            options?.ModifyRequest(request);
            return(request);
        }
 /// <inheritdoc />
 public override Bucket UpdateBucket(
     Bucket bucket,
     UpdateBucketOptions options = null)
 => CreateUpdateBucketRequest(bucket, options).Execute();
 /// <inheritdoc />
 public override Task <Bucket> UpdateBucketAsync(
     Bucket bucket,
     UpdateBucketOptions options         = null,
     CancellationToken cancellationToken = default(CancellationToken))
 => CreateUpdateBucketRequest(bucket, options).ExecuteAsync(cancellationToken);
        private BucketsResource.UpdateRequest CreateUpdateBucketRequest(Bucket bucket, UpdateBucketOptions options)
        {
            ValidateBucket(bucket, nameof(bucket));
            var request = Service.Buckets.Update(bucket, bucket.Name);

            options?.ModifyRequest(request, bucket);
            return(request);
        }