Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <inheritdoc />
 public override Task <Bucket> CreateBucketAsync(string projectId, Bucket bucket, CreateBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 CreateCreateBucketRequest(projectId, bucket, options).ExecuteAsync(cancellationToken);
Ejemplo n.º 4
0
 /// <inheritdoc />
 public override Bucket CreateBucket(string projectId, Bucket bucket, CreateBucketOptions options = null) =>
 CreateCreateBucketRequest(projectId, bucket, options).Execute();
Ejemplo 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();
 }
Ejemplo 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();
 }