Exemplo n.º 1
0
 /// <summary>
 /// Patches the metadata for an object in storage asynchronously.
 /// </summary>
 /// <param name="obj">Object to update. Must not be null, and must have populated <c>Name</c> and
 /// <c>Bucket</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 updated storage object.</returns>
 public virtual Task <Object> PatchObjectAsync(
     Object obj,
     PatchObjectOptions options          = null,
     CancellationToken cancellationToken = default)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 2
0
        private ObjectsResource.PatchRequest CreatePatchObjectRequest(Object obj, PatchObjectOptions 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.Patch(obj, obj.Bucket, obj.Name);

            options?.ModifyRequest(request);
            return(request);
        }
Exemplo n.º 3
0
        private ObjectsResource.PatchRequest CreatePatchObjectRequest(Object obj, PatchObjectOptions 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.Patch(obj, obj.Bucket, obj.Name);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            ApplyEncryptionKey(options?.EncryptionKey, kmsNameFromOptions: null, request);
            return(request);
        }
Exemplo n.º 4
0
 /// <inheritdoc />
 public override Task <Object> PatchObjectAsync(
     Object obj,
     PatchObjectOptions options          = null,
     CancellationToken cancellationToken = default)
 => CreatePatchObjectRequest(obj, options).ExecuteAsync(cancellationToken);
Exemplo n.º 5
0
 /// <inheritdoc />
 public override Object PatchObject(
     Object obj,
     PatchObjectOptions options = null)
 => CreatePatchObjectRequest(obj, options).Execute();
Exemplo n.º 6
0
 /// <summary>
 /// Patches the metadata for an object in storage synchronously.
 /// </summary>
 /// <param name="obj">Object to update. Must not be null, and must have populated <c>Name</c> and
 /// <c>Bucket</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 PatchObject(
     Object obj,
     PatchObjectOptions options = null)
 {
     throw new NotImplementedException();
 }