示例#1
0
 /// <summary>
 /// Updates the metadata for an object in storage asynchronously.
 /// </summary>
 /// <remarks>
 /// As this is a full update, <paramref name="obj"/> must be fully populated. This is typically
 /// obtained by performing another operation (such as <see cref="GetObjectAsync(string, string, GetObjectOptions, CancellationToken)"/>
 /// with a "full" projection, and then modifying the returned object.
 /// </remarks>
 /// <param name="obj">Object 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>
 /// <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="Object"/> representation of the storage object.</returns>
 public virtual Task <Object> UpdateObjectAsync(
     Object obj,
     UpdateObjectOptions options         = null,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
示例#2
0
        private ObjectsResource.UpdateRequest CreateUpdateObjectRequest(Object obj, UpdateObjectOptions options)
        {
            GaxPreconditions.CheckNotNull(obj, nameof(obj));
            GaxPreconditions.CheckArgument(obj.Bucket != null, nameof(obj), "The Bucket property of the object to update is null");
            GaxPreconditions.CheckArgument(obj.Name != null, nameof(obj), "The Name property of the object to update is null");
            var request = Service.Objects.Update(obj, obj.Bucket, obj.Name);

            options?.ModifyRequest(request, obj);
            return(request);
        }
 /// <inheritdoc />
 public override Task <Object> UpdateObjectAsync(
     Object obj,
     UpdateObjectOptions options         = null,
     CancellationToken cancellationToken = default(CancellationToken))
 => CreateUpdateObjectRequest(obj, options).ExecuteAsync(cancellationToken);
 /// <inheritdoc />
 public override Object UpdateObject(
     Object obj,
     UpdateObjectOptions options = null)
 => CreateUpdateObjectRequest(obj, options).Execute();
示例#5
0
 /// <summary>
 /// Updates the metadata for an object in storage synchronously.
 /// </summary>
 /// <remarks>
 /// As this is a full update, <paramref name="obj"/> must be fully populated. This is typically
 /// obtained by performing another operation (such as <see cref="GetObject(string, string, GetObjectOptions)"/>
 /// with a "full" projection, and then modifying the returned object.
 /// </remarks>
 /// <param name="obj">Object 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="Object"/> representation of the updated storage object.</returns>
 public virtual Object UpdateObject(
     Object obj,
     UpdateObjectOptions options = null)
 {
     throw new NotImplementedException();
 }