/// <summary> /// Fetches the information about an object asynchronously. /// </summary> /// <remarks>This does not retrieve the content of the object itself. Use <see cref="DownloadObjectAsync(string, string, System.IO.Stream, DownloadObjectOptions, CancellationToken, System.IProgress{Apis.Download.IDownloadProgress})"/> /// to download the content.</remarks> /// <param name="bucket">The name of the bucket containing the object. Must not be null.</param> /// <param name="objectName">The name of the object within the bucket. Must not be null.</param> /// <param name="options">Additional options for the fetch 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 /// <see cref="Object"/> representation of the storage object.</returns> public virtual Task <Object> GetObjectAsync( string bucket, string objectName, GetObjectOptions options = null, CancellationToken cancellationToken = default) { throw new NotImplementedException(); }
/// <inheritdoc /> public override Task <Object> GetObjectAsync( string bucket, string objectName, GetObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { ValidateBucketName(bucket); GaxPreconditions.CheckNotNull(objectName, nameof(objectName)); return(CreateGetObjectRequest(bucket, objectName, options).ExecuteAsync(cancellationToken)); }
private ObjectsResource.GetRequest CreateGetObjectRequest(string bucket, string objectName, GetObjectOptions options) { var request = Service.Objects.Get(bucket, objectName); options?.ModifyRequest(request); return(request); }
/// <inheritdoc /> public override Object GetObject(string bucket, string objectName, GetObjectOptions options = null) { ValidateBucketName(bucket); GaxPreconditions.CheckNotNull(objectName, nameof(objectName)); return(CreateGetObjectRequest(bucket, objectName, options).Execute()); }
private ObjectsResource.GetRequest CreateGetObjectRequest(string bucket, string objectName, GetObjectOptions options) { var request = Service.Objects.Get(bucket, objectName); request.ModifyRequest += _versionHeaderAction; ApplyEncryptionKey(options?.EncryptionKey, request); options?.ModifyRequest(request); return(request); }
/// <summary> /// Fetches the information about an object synchronously. /// </summary> /// <remarks>This does not retrieve the content of the object itself. Use <see cref="DownloadObject(string, string, System.IO.Stream, DownloadObjectOptions, System.IProgress{Apis.Download.IDownloadProgress})"/> /// to download the content.</remarks> /// <param name="bucket">The name of the bucket containing the object. Must not be null.</param> /// <param name="objectName">The name of the object within the bucket. Must not be null.</param> /// <param name="options">Additional options for the fetch operation. May be null, in which case appropriate /// defaults will be used.</param> /// <returns>The <see cref="Object"/> representation of the storage object.</returns> public virtual Object GetObject(string bucket, string objectName, GetObjectOptions options = null) { throw new NotImplementedException(); }
private ObjectsResource.GetRequest CreateGetObjectRequest(string bucket, string objectName, GetObjectOptions options) { var request = Service.Objects.Get(bucket, objectName); ApplyEncryptionKey(options?.EncryptionKey, kmsNameFromOptions: null, request); options?.ModifyRequest(request); return(request); }