private BucketsResource.InsertRequest CreateCreateBucketRequest(string projectId, Bucket bucket, CreateBucketOptions options)
        {
            GaxPreconditions.CheckNotNull(projectId, nameof(projectId));
            ValidateBucket(bucket, nameof(bucket));
            var request = Service.Buckets.Insert(bucket, projectId);

            options?.ModifyRequest(request);
            return(request);
        }
        private BucketsResource.InsertRequest CreateCreateBucketRequest(string projectId, string bucket, CreateBucketOptions options)
        {
            GaxPreconditions.CheckNotNull(projectId, nameof(projectId));
            ValidateBucketName(bucket);
            var bucketEntity = new Bucket {
                Name = bucket
            };
            var request = Service.Buckets.Insert(bucketEntity, projectId);

            options?.ModifyRequest(request);
            return(request);
        }
 /// <inheritdoc />
 public override Task <Bucket> CreateBucketAsync(string projectId, Bucket bucket, CreateBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 CreateCreateBucketRequest(projectId, bucket, options).ExecuteAsync(cancellationToken);
 /// <inheritdoc />
 public override Bucket CreateBucket(string projectId, Bucket bucket, CreateBucketOptions options = null) =>
 CreateCreateBucketRequest(projectId, bucket, options).Execute();
Esempio n. 5
0
 /// <summary>
 /// Creates a storage bucket asynchronously.
 /// </summary>
 /// <param name="projectId">The ID of the project to create the buckets in. Must not be null.</param>
 /// <param name="bucket">The resource representation of the bucket to create. Must not be null, and must have a name.</param>
 /// <param name="options">Additional options for the 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
 /// resource representation of the newly-created bucket.</returns>
 public virtual Task <Bucket> CreateBucketAsync(string projectId, Bucket bucket, CreateBucketOptions options = null,
                                                CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a storage bucket synchronously.
 /// </summary>
 /// <param name="projectId">The ID of the project to create the buckets in. Must not be null.</param>
 /// <param name="bucket">The resource representation of the bucket to create. Must not be null, and must have a name.</param>
 /// <param name="options">Additional options for the operation. May be null, in which case appropriate
 /// defaults will be used.</param>
 /// <returns>The resource representation of the newly-created bucket.</returns>
 public virtual Bucket CreateBucket(string projectId, Bucket bucket, CreateBucketOptions options = null)
 {
     throw new NotImplementedException();
 }