public sealed class StorageClientImpl : StorageClient, IDisposable
Wrapper around Google.Apis.Storage.v1.StorageService to provide simpler operations.
Implements
System.IDisposableNamespace
Google.Cloud.Storage.V1Assembly
Google.Cloud.Storage.V1.dll
Remarks
This is the "default" implementation of StorageClient. Most client code should refer to StorageClient, creating instances with Create(GoogleCredential, EncryptionKey) and CreateAsync(GoogleCredential, EncryptionKey). The constructor of this class is public for the sake of constructor-based dependency injection.
Constructors
StorageClientImpl(StorageService, EncryptionKey)
public StorageClientImpl(StorageService service, EncryptionKey encryptionKey = null)
Constructs a new client wrapping the given Google.Apis.Storage.v1.StorageService.
Parameters | |
---|---|
Name | Description |
service | Google.Apis.Storage.v1.StorageService The service to wrap. Must not be null. |
encryptionKey | EncryptionKey Optional EncryptionKey to use for object-based operations by default. May be null, in which case None will be used. |
Properties
ApplicationName
public static string ApplicationName { get; set; }
The default application name used when creating a Google.Apis.Storage.v1.StorageService. Defaults to "google-cloud-dotnet"; must not be null.
Property Value | |
---|---|
Type | Description |
System.String |
Most applications will never want to set this, which is why it's in this class rather than StorageClient.
EncryptionKey
public override EncryptionKey EncryptionKey { get; }
The customer-supplied encryption key used by default for all relevant object-based operations. This can be overridden in call-specific options. This will never return null in the built-in implementation; if no encryption key is specified, None is returned.
Property Value | |
---|---|
Type | Description |
EncryptionKey |
Service
public override StorageService Service { get; }
The underlying storage service object used by this client.
Property Value | |
---|---|
Type | Description |
Google.Apis.Storage.v1.StorageService |
The StorageClient class only provides convenience operations built on top of an existing service object. Any more complex operations which are not supported by this wrapper may wish to use the same service object as the wrapper, in order to take advantage of its configuration (for authentication, application naming etc).
Methods
ClearBucketLabels(String, ModifyBucketLabelsOptions)
public override IDictionary<string, string> ClearBucketLabels(string bucket, ModifyBucketLabelsOptions options = null)
Clears all labels on a bucket.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
options | ModifyBucketLabelsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
System.Collections.Generic.IDictionary<System.String, System.String> | A dictionary with the labels on the bucket before they were cleared. |
ClearBucketLabelsAsync(String, ModifyBucketLabelsOptions, CancellationToken)
public override Task<IDictionary<string, string>> ClearBucketLabelsAsync(string bucket, ModifyBucketLabelsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Clears all labels on a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
options | ModifyBucketLabelsOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<System.String, System.String>> | A dictionary with the labels on the bucket before they were cleared. |
CopyObject(String, String, String, String, CopyObjectOptions)
public override Object CopyObject(string sourceBucket, string sourceObjectName, string destinationBucket, string destinationObjectName, CopyObjectOptions options = null)
Creates a copy of an object synchronously, potentially to a different bucket. This method uses the
rewriteObject
underlying API operation for more flexibility and reliability.
Parameters | |
---|---|
Name | Description |
sourceBucket | System.String The name of the bucket containing the object to copy. Must not be null. |
sourceObjectName | System.String The name of the object to copy within the bucket. Must not be null. |
destinationBucket | System.String The name of the bucket to copy the object to. Must not be null. |
destinationObjectName | System.String The name of the object within the destination bucket. Must not be null. |
options | CopyObjectOptions Additional options for the copy operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Object | The Google.Apis.Storage.v1.Data.Object representation of the new storage object resulting from the copy. |
CopyObjectAsync(String, String, String, String, CopyObjectOptions, CancellationToken)
public override Task<Object> CopyObjectAsync(string sourceBucket, string sourceObjectName, string destinationBucket, string destinationObjectName, CopyObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a copy of an object synchronously, potentially to a different bucket. This method uses the
rewriteObject
underlying API operation for more flexibility and reliability.
Parameters | |
---|---|
Name | Description |
sourceBucket | System.String The name of the bucket containing the object to copy. Must not be null. |
sourceObjectName | System.String The name of the object to copy within the bucket. Must not be null. |
destinationBucket | System.String The name of the bucket to copy the object to. Must not be null. |
destinationObjectName | System.String The name of the object within the destination bucket. Must not be null. |
options | CopyObjectOptions Additional options for the copy operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Object> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Object representation of the new storage object resulting from the copy. |
CreateBucket(String, Bucket, CreateBucketOptions)
public override Bucket CreateBucket(string projectId, Bucket bucket, CreateBucketOptions options = null)
Creates a storage bucket synchronously.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project to create the buckets in. Must not be null. |
bucket | Google.Apis.Storage.v1.Data.Bucket The resource representation of the bucket to create. Must not be null, and must have a name. |
options | CreateBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Bucket | The resource representation of the newly-created bucket. |
CreateBucket(String, String, CreateBucketOptions)
public override Bucket CreateBucket(string projectId, string bucket, CreateBucketOptions options = null)
Creates a storage bucket synchronously.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project to create the buckets in. Must not be null. |
bucket | System.String The name of the bucket to create. Must not be null. |
options | CreateBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Bucket | The resource representation of the newly-created bucket. |
CreateBucketAsync(String, Bucket, CreateBucketOptions, CancellationToken)
public override Task<Bucket> CreateBucketAsync(string projectId, Bucket bucket, CreateBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a storage bucket asynchronously.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project to create the buckets in. Must not be null. |
bucket | Google.Apis.Storage.v1.Data.Bucket The resource representation of the bucket to create. Must not be null, and must have a name. |
options | CreateBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Bucket> | A task representing the asynchronous operation, with a result returning the resource representation of the newly-created bucket. |
CreateBucketAsync(String, String, CreateBucketOptions, CancellationToken)
public override Task<Bucket> CreateBucketAsync(string projectId, string bucket, CreateBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Creates a storage bucket asynchronously.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project to create the buckets in. Must not be null. |
bucket | System.String The name of the bucket to create. Must not be null. |
options | CreateBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Bucket> | A task representing the asynchronous operation, with a result returning the resource representation of the newly-created bucket. |
CreateHmacKey(String, String, CreateHmacKeyOptions)
public override HmacKey CreateHmacKey(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options = null)
Synchronously creates a new HMAC key associated with a service account.
Parameters | |
---|---|
Name | Description |
projectId | System.String The project ID in which to create the HMAC key. Must not be null. |
serviceAccountEmail | System.String The service account to associate with the HMAC key. Must not be null. |
options | CreateHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.HmacKey | The new HMAC key, including the secret information in Google.Apis.Storage.v1.Data.HmacKey.Secret. This secret is only ever returned when creating a key. |
CreateHmacKeyAsync(String, String, CreateHmacKeyOptions, CancellationToken)
public override Task<HmacKey> CreateHmacKeyAsync(string projectId, string serviceAccountEmail, CreateHmacKeyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a new HMAC key associated with a service account.
Parameters | |
---|---|
Name | Description |
projectId | System.String The project ID in which to create the HMAC key. Must not be null. |
serviceAccountEmail | System.String The service account to associate with the HMAC key. Must not be null. |
options | CreateHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.HmacKey> | A task representing the asynchronous operation, with a result returning the the new HMAC key, including the secret information in Google.Apis.Storage.v1.Data.HmacKey.Secret. This secret is only ever returned when creating a key. |
CreateNotification(String, Notification, CreateNotificationOptions)
public override Notification CreateNotification(string bucket, Notification notification, CreateNotificationOptions options = null)
Creates a notification configuration.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket for which to create the notification configuration. Must not be null. |
notification | Google.Apis.Storage.v1.Data.Notification The notification configuration to create. Must not be null. |
options | CreateNotificationOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Notification | The Google.Apis.Storage.v1.Data.Notification representation of the newly-created notification configuration. |
CreateNotificationAsync(String, Notification, CreateNotificationOptions, CancellationToken)
public override Task<Notification> CreateNotificationAsync(string bucket, Notification notification, CreateNotificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a notification configuration.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket for which to create the notification configuration. Must not be null. |
notification | Google.Apis.Storage.v1.Data.Notification The notification configuration to create. Must not be null. |
options | CreateNotificationOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Notification> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Notification representation of the newly-created notification configuration. |
CreateObjectUploader(Object, Stream, UploadObjectOptions)
public override ObjectsResource.InsertMediaUpload CreateObjectUploader(Object destination, Stream source, UploadObjectOptions options = null)
Creates an instance which is capable of starting a resumable upload for an object.
Parameters | |
---|---|
Name | Description |
destination | Google.Apis.Storage.v1.Data.Object Object to create or update. Must not be null, and must have the name, bucket and content type populated. |
source | System.IO.Stream The stream to read the data from. Must not be null. |
options | UploadObjectOptions Additional options for the upload. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload | The Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload which can be used to upload the object. |
CreateObjectUploader(String, String, String, Stream, UploadObjectOptions)
public override ObjectsResource.InsertMediaUpload CreateObjectUploader(string bucket, string objectName, string contentType, Stream source, UploadObjectOptions options = null)
Creates an instance which is capable of starting a resumable upload for an object.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
contentType | System.String The content type of the object. This should be a MIME type such as "text/html" or "application/octet-stream". May be null. |
source | System.IO.Stream The stream to read the data from. Must not be null. |
options | UploadObjectOptions Additional options for the upload. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload | The Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload which can be used to upload the object. |
DeleteBucket(Bucket, DeleteBucketOptions)
public override void DeleteBucket(Bucket bucket, DeleteBucketOptions options = null)
Deletes a bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | Google.Apis.Storage.v1.Data.Bucket Bucket to delete. Must not be null, and must have the name populated. |
options | DeleteBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
DeleteBucket(String, DeleteBucketOptions)
public override void DeleteBucket(string bucket, DeleteBucketOptions options = null)
Deletes a bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket to delete. Must not be null. |
options | DeleteBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
DeleteBucketAsync(Bucket, DeleteBucketOptions, CancellationToken)
public override Task DeleteBucketAsync(Bucket bucket, DeleteBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | Google.Apis.Storage.v1.Data.Bucket Bucket to delete. Must not be null, and must have the name populated. |
options | DeleteBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
DeleteBucketAsync(String, DeleteBucketOptions, CancellationToken)
public override Task DeleteBucketAsync(string bucket, DeleteBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket to delete. Must not be null. |
options | DeleteBucketOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
DeleteHmacKey(String, String, DeleteHmacKeyOptions)
public override void DeleteHmacKey(string projectId, string accessId, DeleteHmacKeyOptions options = null)
Synchronously deletes an HMAC key, which must already have been deactivated.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project containing the HMAC key to delete. |
accessId | System.String The ID of the HMAC key to delete. Must not be null. |
options | DeleteHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
DeleteHmacKeyAsync(String, String, DeleteHmacKeyOptions, CancellationToken)
public override Task DeleteHmacKeyAsync(string projectId, string accessId, DeleteHmacKeyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously deletes an HMAC key, which must already have been deactivated.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project containing the HMAC key to delete. |
accessId | System.String The ID of the HMAC key to delete. Must not be null. |
options | DeleteHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
DeleteNotification(String, String, DeleteNotificationOptions)
public override void DeleteNotification(string bucket, string notificationId, DeleteNotificationOptions options = null)
Deletes a notification configuration.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket associated with the notification configuration. Must not be null. |
notificationId | System.String ID of the notification configuration to delete. Must not be null. |
options | DeleteNotificationOptions The options for the operation. May be null, in which case defaults will be supplied. |
DeleteNotificationAsync(String, String, DeleteNotificationOptions, CancellationToken)
public override Task DeleteNotificationAsync(string bucket, string notificationId, DeleteNotificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously deletes a notification configuration.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket associated with the notification configuration. Must not be null. |
notificationId | System.String ID of the notification configuration to delete. Must not be null. |
options | DeleteNotificationOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
DeleteObject(Object, DeleteObjectOptions)
public override void DeleteObject(Object obj, DeleteObjectOptions options = null)
Deletes a version of the specified object synchronously.
Parameters | |
---|---|
Name | Description |
obj | Google.Apis.Storage.v1.Data.Object Object to delete. Must not be null, and must have the name and bucket populated. |
options | DeleteObjectOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
By default this will delete the latest version of the object, but this can be
controlled using Generation. Note that any generation information
contained within obj
is ignored; the generation to delete is only controlled
via options
. For buckets that support
multiple versions, implicitly deleting the latest version only archives
it so the object is still available and can be listed by specifying Versions.
If the version is explicitly specified, the object is permanently deleted.
If the bucket containing the object supports versioning, after this operation completes successfully there may still be another version of the same object. In buckets which do not support versioning, this operation will permanently delete the object.
If the request attempts to delete an object that does not exist or a specific version that does not exist, this counts as a failure with an HTTP status code of 404.
DeleteObject(String, String, DeleteObjectOptions)
public override void DeleteObject(string bucket, string objectName, DeleteObjectOptions options = null)
Deletes a version of the specified object synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
options | DeleteObjectOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
By default this will delete the latest version of the object, but this can be controlled using Generation. For buckets that support multiple versions, implicitly deleting the latest version only archives it so the object is still available and can be listed by specifying Versions. If the version is explicitly specified, the object is permanently deleted.
If the bucket containing the object supports versioning, after this operation completes successfully there may still be another version of the same object. In buckets which do not support versioning, this operation will permanently delete the object.
If the request attempts to delete an object that does not exist or a specific version that does not exist, this counts as a failure with an HTTP status code of 404.
DeleteObjectAsync(Object, DeleteObjectOptions, CancellationToken)
public override Task DeleteObjectAsync(Object obj, DeleteObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a version of the specified object asynchronously.
Parameters | |
---|---|
Name | Description |
obj | Google.Apis.Storage.v1.Data.Object Object to delete. Must not be null, and must have the name and bucket populated. |
options | DeleteObjectOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
By default this will delete the latest version of the object, but this can be
controlled using Generation. Note that any generation information
contained within obj
is ignored; the generation to delete is only controlled
via options
. For buckets that support
multiple versions, implicitly deleting the latest version only archives
it so the object is still available and can be listed by specifying Versions.
If the version is explicitly specified, the object is permanently deleted.
If the bucket containing the object supports versioning, after this operation completes successfully there may still be another version of the same object. In buckets which do not support versioning, this operation will permanently delete the object.
If the request attempts to delete an object that does not exist or a specific version that does not exist, this counts as a failure with an HTTP status code of 404.
DeleteObjectAsync(String, String, DeleteObjectOptions, CancellationToken)
public override Task DeleteObjectAsync(string bucket, string objectName, DeleteObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Deletes a version of the specified object asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
options | DeleteObjectOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
By default this will delete the latest version of the object, but this can be controlled using Generation. For buckets that support multiple versions, implicitly deleting the latest version only archives it so the object is still available and can be listed by specifying Versions. If the version is explicitly specified, the object is permanently deleted.
If the bucket containing the object supports versioning, after this operation completes successfully there may still be another version of the same object. In buckets which do not support versioning, this operation will permanently delete the object.
If the request attempts to delete an object that does not exist or a specific version that does not exist, this counts as a failure with an HTTP status code of 404.
Dispose()
public override void Dispose()
Dispose of this instance. See the StorageClient remarks on when this should be called.
DownloadObject(Object, Stream, DownloadObjectOptions, IProgress<IDownloadProgress>)
public override void DownloadObject(Object source, Stream destination, DownloadObjectOptions options = null, IProgress<IDownloadProgress> progress = null)
Downloads the data for an object from storage synchronously, into a specified stream.
Parameters | |
---|---|
Name | Description |
source | Google.Apis.Storage.v1.Data.Object Source object to download the data from. Must not be null. |
destination | System.IO.Stream The stream to write the data into. Must not be null. |
options | DownloadObjectOptions Additional options for the download. May be null, in which case appropriate defaults will be used. |
progress | System.IProgress<Google.Apis.Download.IDownloadProgress> Progress reporter for the download. May be null. |
The generation number within source
is ignored by this method.
To download a specific generation, use Generation.
DownloadObject(String, String, Stream, DownloadObjectOptions, IProgress<IDownloadProgress>)
public override void DownloadObject(string bucket, string objectName, Stream destination, DownloadObjectOptions options = null, IProgress<IDownloadProgress> progress = null)
Downloads the data for an object from storage synchronously, into a specified stream.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
destination | System.IO.Stream The stream to write the data into. Must not be null. |
options | DownloadObjectOptions Additional options for the download. May be null, in which case appropriate defaults will be used. |
progress | System.IProgress<Google.Apis.Download.IDownloadProgress> Progress reporter for the download. May be null. |
DownloadObjectAsync(Object, Stream, DownloadObjectOptions, CancellationToken, IProgress<IDownloadProgress>)
public override Task DownloadObjectAsync(Object source, Stream destination, DownloadObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken), IProgress<IDownloadProgress> progress = null)
Downloads the data for an object from storage asynchronously, into a specified stream.
Parameters | |
---|---|
Name | Description |
source | Google.Apis.Storage.v1.Data.Object Source object to download the data from. Must not be null. |
destination | System.IO.Stream The stream to write the data into. Must not be null. |
options | DownloadObjectOptions Additional options for the download. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
progress | System.IProgress<Google.Apis.Download.IDownloadProgress> Progress reporter for the download. May be null. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
The generation number within source
is ignored by this method.
To download a specific generation, use Generation.
DownloadObjectAsync(String, String, Stream, DownloadObjectOptions, CancellationToken, IProgress<IDownloadProgress>)
public override Task DownloadObjectAsync(string bucket, string objectName, Stream destination, DownloadObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken), IProgress<IDownloadProgress> progress = null)
Downloads the data for an object from storage asynchronously, into a specified stream.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
destination | System.IO.Stream The stream to write the data into. Must not be null. |
options | DownloadObjectOptions Additional options for the download. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
progress | System.IProgress<Google.Apis.Download.IDownloadProgress> Progress reporter for the download. May be null. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
GetBucket(String, GetBucketOptions)
public override Bucket GetBucket(string bucket, GetBucketOptions options = null)
Fetches the information about a bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
options | GetBucketOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Bucket | The Google.Apis.Storage.v1.Data.Bucket representation of the storage bucket. |
GetBucketAsync(String, GetBucketOptions, CancellationToken)
public override Task<Bucket> GetBucketAsync(string bucket, GetBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Fetches the information about a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
options | GetBucketOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Bucket> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Bucket representation of the storage bucket. |
GetBucketIamPolicy(String, GetBucketIamPolicyOptions)
public override Policy GetBucketIamPolicy(string bucket, GetBucketIamPolicyOptions options = null)
Fetches the IAM policy information about a bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
options | GetBucketIamPolicyOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Policy | The Google.Apis.Storage.v1.Data.Policy representation of the storage bucket IAM policy. |
GetBucketIamPolicyAsync(String, GetBucketIamPolicyOptions, CancellationToken)
public override Task<Policy> GetBucketIamPolicyAsync(string bucket, GetBucketIamPolicyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Fetches the IAM policy information about a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
options | GetBucketIamPolicyOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Policy> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Policy representation of the storage bucket IAM policy. |
GetHmacKey(String, String, GetHmacKeyOptions)
public override HmacKeyMetadata GetHmacKey(string projectId, string accessId, GetHmacKeyOptions options = null)
Synchronously fetches metadata for the specified HMAC key.
Parameters | |
---|---|
Name | Description |
projectId | System.String The project containing the HMAC key. Must not be null. |
accessId | System.String The ID of the HMAC key. Must not be null. |
options | GetHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.HmacKeyMetadata | The HMAC key metadata |
GetHmacKeyAsync(String, String, GetHmacKeyOptions, CancellationToken)
public override Task<HmacKeyMetadata> GetHmacKeyAsync(string projectId, string accessId, GetHmacKeyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously fetches metadata for the specified HMAC key.
Parameters | |
---|---|
Name | Description |
projectId | System.String The project containing the HMAC key. Must not be null. |
accessId | System.String The ID of the HMAC key. Must not be null. |
options | GetHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.HmacKeyMetadata> | A task representing the asynchronous operation, with a result returning the HMAC key metadata. |
GetNotification(String, String, GetNotificationOptions)
public override Notification GetNotification(string bucket, string notificationId, GetNotificationOptions options = null)
Fetches a notification configuration.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket associated with the notification configuration. Must not be null. |
notificationId | System.String ID of the notification configuration to fetch. Must not be null. |
options | GetNotificationOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Notification | The Google.Apis.Storage.v1.Data.Notification representation of the notification configuration. |
GetNotificationAsync(String, String, GetNotificationOptions, CancellationToken)
public override Task<Notification> GetNotificationAsync(string bucket, string notificationId, GetNotificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously fetches a notification configuration.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket associated with the notification configuration. Must not be null. |
notificationId | System.String ID of the notification configuration to fetch. Must not be null. |
options | GetNotificationOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Notification> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Notification representation of the notification configuration. |
GetObject(String, String, GetObjectOptions)
public override Object GetObject(string bucket, string objectName, GetObjectOptions options = null)
Fetches the information about an object synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
options | GetObjectOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Object | The Google.Apis.Storage.v1.Data.Object representation of the storage object. |
This does not retrieve the content of the object itself. Use DownloadObject(String, String, Stream, DownloadObjectOptions, IProgress<IDownloadProgress>) to download the content.
GetObjectAsync(String, String, GetObjectOptions, CancellationToken)
public override Task<Object> GetObjectAsync(string bucket, string objectName, GetObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Fetches the information about an object asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
options | GetObjectOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Object> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Object representation of the storage object. |
This does not retrieve the content of the object itself. Use DownloadObjectAsync(String, String, Stream, DownloadObjectOptions, CancellationToken, IProgress<IDownloadProgress>) to download the content.
GetStorageServiceAccountEmail(String, GetStorageServiceAccountEmailOptions)
public override string GetStorageServiceAccountEmail(string projectId, GetStorageServiceAccountEmailOptions options = null)
Retrieves the service account email address that Google Cloud Storage uses for operations on other services such as Google Cloud Pub/Sub.
Parameters | |
---|---|
Name | Description |
projectId | System.String ID of the project to retrieve the service account for. Must not be null. |
options | GetStorageServiceAccountEmailOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
System.String | The email address of the service account. |
GetStorageServiceAccountEmailAsync(String, GetStorageServiceAccountEmailOptions, CancellationToken)
public override Task<string> GetStorageServiceAccountEmailAsync(string projectId, GetStorageServiceAccountEmailOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously retrieves the service account email address that Google Cloud Storage uses for operations on other services such as Google Cloud Pub/Sub.
Parameters | |
---|---|
Name | Description |
projectId | System.String ID of the project to retrieve the service account for. Must not be null. |
options | GetStorageServiceAccountEmailOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<System.String> | A task representing the asynchronous operation, with a result returning the email address of the service account. |
ListBuckets(String, ListBucketsOptions)
public override PagedEnumerable<Buckets, Bucket> ListBuckets(string projectId, ListBucketsOptions options = null)
Lists the buckets for a given project, synchronously but lazily.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project to list the buckets from. Must not be null. |
options | ListBucketsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
Google.Api.Gax.PagedEnumerable<Google.Apis.Storage.v1.Data.Buckets, Google.Apis.Storage.v1.Data.Bucket> | A sequence of buckets within the project. |
This method fetches the buckets lazily, making requests to the underlying service for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.
ListBucketsAsync(String, ListBucketsOptions)
public override PagedAsyncEnumerable<Buckets, Bucket> ListBucketsAsync(string projectId, ListBucketsOptions options = null)
Asynchronously lists the buckets in a given project.
Parameters | |
---|---|
Name | Description |
projectId | System.String The ID of the project to list the buckets from. Must not be null. |
options | ListBucketsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
Google.Api.Gax.PagedAsyncEnumerable<Google.Apis.Storage.v1.Data.Buckets, Google.Apis.Storage.v1.Data.Bucket> | An asynchronous sequence of buckets. |
This method fetches the buckets lazily, making requests to the underlying service for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.
ListHmacKeys(String, String, ListHmacKeysOptions)
public override PagedEnumerable<HmacKeysMetadata, HmacKeyMetadata> ListHmacKeys(string projectId, string serviceAccountEmail = null, ListHmacKeysOptions options = null)
Lists the HMAC keys in a given project, synchronously but lazily, optionally filtering by service account email address.
Parameters | |
---|---|
Name | Description |
projectId | System.String The project containing the HMAC keys. Must not be null. |
serviceAccountEmail | System.String The service account email address to list keys for. May be null, in which case all HMAC keys associated with the project are returned. |
options | ListHmacKeysOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Api.Gax.PagedEnumerable<Google.Apis.Storage.v1.Data.HmacKeysMetadata, Google.Apis.Storage.v1.Data.HmacKeyMetadata> | A sequence of HMAC keys within the project. |
This method fetches the buckets lazily, making requests to the underlying service for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.
ListHmacKeysAsync(String, String, ListHmacKeysOptions)
public override PagedAsyncEnumerable<HmacKeysMetadata, HmacKeyMetadata> ListHmacKeysAsync(string projectId, string serviceAccountEmail = null, ListHmacKeysOptions options = null)
Lists the HMAC keys in a given project, asynchronously and lazily, optionally filtering by service account email address.
Parameters | |
---|---|
Name | Description |
projectId | System.String The project containing the HMAC keys. Must not be null. |
serviceAccountEmail | System.String The service account email address to list keys for. May be null, in which case all HMAC keys associated with the project are returned. |
options | ListHmacKeysOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Api.Gax.PagedAsyncEnumerable<Google.Apis.Storage.v1.Data.HmacKeysMetadata, Google.Apis.Storage.v1.Data.HmacKeyMetadata> | An asynchronous sequence of HMAC keys within the project. |
This method fetches the buckets lazily, making requests to the underlying service for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.
ListNotifications(String, ListNotificationsOptions)
public override IReadOnlyList<Notification> ListNotifications(string bucket, ListNotificationsOptions options = null)
Lists notification configurations associated with a bucket.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket for which to list associated notification configurations. Must not be null. |
options | ListNotificationsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
System.Collections.Generic.IReadOnlyList<Google.Apis.Storage.v1.Data.Notification> | A list of notification configurations associated with the specified bucket. This method never returns null. |
ListNotificationsAsync(String, ListNotificationsOptions, CancellationToken)
public override Task<IReadOnlyList<Notification>> ListNotificationsAsync(string bucket, ListNotificationsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously lists notification configurations associated with a bucket.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket for which to list associated notification configurations. Must not be null. |
options | ListNotificationsOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Google.Apis.Storage.v1.Data.Notification>> | A task representing the asynchronous operation, with a result returning the list of notification configurations associated with the specified bucket. The result is never null. |
ListObjects(String, String, ListObjectsOptions)
public override PagedEnumerable<Objects, Object> ListObjects(string bucket, string prefix = null, ListObjectsOptions options = null)
Lists the objects in a given bucket, synchronously but lazily.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket to list the objects from. Must not be null. |
prefix | System.String The prefix to match. Only objects with names that start with this string will be returned. This parameter may be null or empty, in which case no filtering is performed. |
options | ListObjectsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
Google.Api.Gax.PagedEnumerable<Google.Apis.Storage.v1.Data.Objects, Google.Apis.Storage.v1.Data.Object> | A sequence of objects in the specified bucket. |
This method fetches the objects lazily, making requests to the underlying service for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.
ListObjectsAsync(String, String, ListObjectsOptions)
public override PagedAsyncEnumerable<Objects, Object> ListObjectsAsync(string bucket, string prefix = null, ListObjectsOptions options = null)
Asynchronously lists the objects in a given bucket.
Parameters | |
---|---|
Name | Description |
bucket | System.String The bucket to list the objects from. Must not be null. |
prefix | System.String The prefix to match. Only objects with names that start with this string will be returned. This parameter may be null or empty, in which case no filtering is performed. |
options | ListObjectsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
Google.Api.Gax.PagedAsyncEnumerable<Google.Apis.Storage.v1.Data.Objects, Google.Apis.Storage.v1.Data.Object> | An asynchronous sequence of objects in the specified bucket. |
This method fetches the objects lazily, making requests to the underlying service for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated. This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network or service failures can cause exceptions even after the first results have been returned.
LockBucketRetentionPolicy(String, Int64, LockBucketRetentionPolicyOptions)
public override void LockBucketRetentionPolicy(string bucket, long metageneration, LockBucketRetentionPolicyOptions options = null)
Locks the retention policy of a bucket. This is a one-way process: once a retention policy is locked, it cannot be shortened, removed or unlocked, although it can be increased in duration. The lock persists until the bucket is deleted.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket whose retention policy should be locked. Must not be null. |
metageneration | System.Int64 The current metageneration of the bucket, used to validate that the bucket version to be locked is the intended one. |
options | LockBucketRetentionPolicyOptions The options for the operation. May be null, in which case defaults will be supplied. |
LockBucketRetentionPolicyAsync(String, Int64, LockBucketRetentionPolicyOptions, CancellationToken)
public override Task LockBucketRetentionPolicyAsync(string bucket, long metageneration, LockBucketRetentionPolicyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously locks the retention policy of a bucket. This is a one-way process: once a retention policy is locked, it cannot be shortened, removed or unlocked, although it can be increased in duration. The lock persists until the bucket is deleted.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket whose retention policy should be locked. Must not be null. |
metageneration | System.Int64 The current metageneration of the bucket, used to validate that the bucket version to be locked is the intended one. |
options | LockBucketRetentionPolicyOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous operation. |
ModifyBucketLabels(String, IDictionary<String, String>, ModifyBucketLabelsOptions)
public override IDictionary<string, string> ModifyBucketLabels(string bucket, IDictionary<string, string> labels, ModifyBucketLabelsOptions options = null)
Sets or removes one or more labels on a bucket.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
labels | System.Collections.Generic.IDictionary<System.String, System.String> The labels to set. Must contain at least one entry; keys must not be null, but values may be (indicating label removal). |
options | ModifyBucketLabelsOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
System.Collections.Generic.IDictionary<System.String, System.String> | A dictionary with the same keys as |
Each entry in labels
is treated as a label to set or remove. If the value is null,
it will be removed from the bucket; otherwise, it will be set/added. Labels which do not have an entry
in the dictionary will be ignored.
ModifyBucketLabelsAsync(String, IDictionary<String, String>, ModifyBucketLabelsOptions, CancellationToken)
public override Task<IDictionary<string, string>> ModifyBucketLabelsAsync(string bucket, IDictionary<string, string> labels, ModifyBucketLabelsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Sets or removes one or more labels on a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
labels | System.Collections.Generic.IDictionary<System.String, System.String> The labels to set. Must contain at least one entry; keys must not be null, but values may be (indicating label removal). |
options | ModifyBucketLabelsOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<System.String, System.String>> | A dictionary with the same keys as |
Each entry in labels
is treated as a label to set or remove. If the value is null,
it will be removed from the bucket; otherwise, it will be set/added. Labels which do not have an entry
in the dictionary will be ignored.
PatchBucket(Bucket, PatchBucketOptions)
public override Bucket PatchBucket(Bucket bucket, PatchBucketOptions options = null)
Patches the metadata for a storage bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | Google.Apis.Storage.v1.Data.Bucket Bucket to update. Must not be null, and must have a populated |
options | PatchBucketOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Bucket | The Google.Apis.Storage.v1.Data.Bucket representation of the updated storage bucket. |
PatchBucketAsync(Bucket, PatchBucketOptions, CancellationToken)
public override Task<Bucket> PatchBucketAsync(Bucket bucket, PatchBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Patches the metadata for a storage bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | Google.Apis.Storage.v1.Data.Bucket Bucket to update. Must not be null, and must have a populated |
options | PatchBucketOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Bucket> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Bucket representation of the bucket storage bucket. |
PatchObject(Object, PatchObjectOptions)
public override Object PatchObject(Object obj, PatchObjectOptions options = null)
Patches the metadata for an object in storage synchronously.
Parameters | |
---|---|
Name | Description |
obj | Google.Apis.Storage.v1.Data.Object Object to update. Must not be null, and must have populated |
options | PatchObjectOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Object | The Google.Apis.Storage.v1.Data.Object representation of the updated storage object. |
PatchObjectAsync(Object, PatchObjectOptions, CancellationToken)
public override Task<Object> PatchObjectAsync(Object obj, PatchObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Patches the metadata for an object in storage asynchronously.
Parameters | |
---|---|
Name | Description |
obj | Google.Apis.Storage.v1.Data.Object Object to update. Must not be null, and must have populated |
options | PatchObjectOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Object> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Object representation of the updated storage object. |
SetBucketIamPolicy(String, Policy, SetBucketIamPolicyOptions)
public override Policy SetBucketIamPolicy(string bucket, Policy policy, SetBucketIamPolicyOptions options = null)
Updates the IAM policy information about a bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
policy | Google.Apis.Storage.v1.Data.Policy The new IAM policy for the bucket. Must not be null. |
options | SetBucketIamPolicyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Policy | The Google.Apis.Storage.v1.Data.Policy representation of the resulting storage bucket IAM policy. |
SetBucketIamPolicyAsync(String, Policy, SetBucketIamPolicyOptions, CancellationToken)
public override Task<Policy> SetBucketIamPolicyAsync(string bucket, Policy policy, SetBucketIamPolicyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Updates the IAM policy information about a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
policy | Google.Apis.Storage.v1.Data.Policy The new IAM policy for the bucket. Must not be null. |
options | SetBucketIamPolicyOptions Additional options for the fetch operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Policy> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Policy representation of the resulting storage bucket IAM policy. |
TestBucketIamPermissions(String, IEnumerable<String>, TestBucketIamPermissionsOptions)
public override IList<string> TestBucketIamPermissions(string bucket, IEnumerable<string> permissions, TestBucketIamPermissionsOptions options = null)
Tests the IAM permissions for a bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
permissions | System.Collections.Generic.IEnumerable<System.String> The permissions to test. Must not be null or empty. |
options | TestBucketIamPermissionsOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
System.Collections.Generic.IList<System.String> | The permissions held by the caller. |
TestBucketIamPermissionsAsync(String, IEnumerable<String>, TestBucketIamPermissionsOptions, CancellationToken)
public override Task<IList<string>> TestBucketIamPermissionsAsync(string bucket, IEnumerable<string> permissions, TestBucketIamPermissionsOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Tests the IAM policy information about a bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket. Must not be null. |
permissions | System.Collections.Generic.IEnumerable<System.String> The permissions to test. Must not be null or empty. |
options | TestBucketIamPermissionsOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<System.Collections.Generic.IList<System.String>> | A task representing the asynchronous operation, with a result returning the permissions held by the caller. |
UpdateBucket(Bucket, UpdateBucketOptions)
public override Bucket UpdateBucket(Bucket bucket, UpdateBucketOptions options = null)
Updates the metadata for a storage bucket synchronously.
Parameters | |
---|---|
Name | Description |
bucket | Google.Apis.Storage.v1.Data.Bucket Bucket to update. Must not be null, and must have a populated |
options | UpdateBucketOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Bucket | The Google.Apis.Storage.v1.Data.Bucket representation of the updated storage bucket. |
If no preconditions are explicitly set in options
, the metageneration of bucket
is used as a precondition for the update, unless ForceNoPreconditions is
set to true
.
UpdateBucketAsync(Bucket, UpdateBucketOptions, CancellationToken)
public override Task<Bucket> UpdateBucketAsync(Bucket bucket, UpdateBucketOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Updates the metadata for storage bucket asynchronously.
Parameters | |
---|---|
Name | Description |
bucket | Google.Apis.Storage.v1.Data.Bucket Bucket to update. Must not be null, and must have a populated |
options | UpdateBucketOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Bucket> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Bucket representation of the storage bucket. |
If no preconditions are explicitly set in options
, the metageneration of bucket
is used as a precondition for the update, unless ForceNoPreconditions is
set to true
.
UpdateHmacKey(HmacKeyMetadata, UpdateHmacKeyOptions)
public override HmacKeyMetadata UpdateHmacKey(HmacKeyMetadata key, UpdateHmacKeyOptions options = null)
Synchronously updates an HMAC key's metadata.
Parameters | |
---|---|
Name | Description |
key | Google.Apis.Storage.v1.Data.HmacKeyMetadata The key to update. Must not be null, and the Google.Apis.Storage.v1.Data.HmacKeyMetadata.ProjectId and Google.Apis.Storage.v1.Data.HmacKeyMetadata.AccessId properties must be set. |
options | UpdateHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.HmacKeyMetadata | The updated key metadata. |
UpdateHmacKeyAsync(HmacKeyMetadata, UpdateHmacKeyOptions, CancellationToken)
public override Task<HmacKeyMetadata> UpdateHmacKeyAsync(HmacKeyMetadata key, UpdateHmacKeyOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Asynchronously updates an HMAC key's metadata.
Parameters | |
---|---|
Name | Description |
key | Google.Apis.Storage.v1.Data.HmacKeyMetadata The key to update. Must not be null, and the Google.Apis.Storage.v1.Data.HmacKeyMetadata.ProjectId and Google.Apis.Storage.v1.Data.HmacKeyMetadata.AccessId properties must be set. |
options | UpdateHmacKeyOptions Additional options for the operation. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.HmacKeyMetadata> | A task representing the asynchronous operation, with a result returning the updated key metadata. |
UpdateObject(Object, UpdateObjectOptions)
public override Object UpdateObject(Object obj, UpdateObjectOptions options = null)
Updates the metadata for an object in storage synchronously.
Parameters | |
---|---|
Name | Description |
obj | Google.Apis.Storage.v1.Data.Object Object to update. Must not be null, and must have populated |
options | UpdateObjectOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Object | The Google.Apis.Storage.v1.Data.Object representation of the updated storage object. |
If no preconditions are explicitly set in options
, the generation and
metageneration of obj
are used as a precondition for the update,
unless ForceNoPreconditions is
set to true
.
UpdateObjectAsync(Object, UpdateObjectOptions, CancellationToken)
public override Task<Object> UpdateObjectAsync(Object obj, UpdateObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Updates the metadata for an object in storage asynchronously.
Parameters | |
---|---|
Name | Description |
obj | Google.Apis.Storage.v1.Data.Object Object to update. Must not be null, and must have populated |
options | UpdateObjectOptions Additional options for the update. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Object> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Object representation of the storage object. |
If no preconditions are explicitly set in options
, the generation and
metageneration of obj
are used as a precondition for the update,
unless ForceNoPreconditions is
set to true
.
UploadObject(Object, Stream, UploadObjectOptions, IProgress<IUploadProgress>)
public override Object UploadObject(Object destination, Stream source, UploadObjectOptions options = null, IProgress<IUploadProgress> progress = null)
Uploads the data for an object in storage synchronously, from a specified stream.
Parameters | |
---|---|
Name | Description |
destination | Google.Apis.Storage.v1.Data.Object Object to create or update. Must not be null, and must have the name, bucket and content type populated. |
source | System.IO.Stream The stream to read the data from. Must not be null. |
options | UploadObjectOptions Additional options for the upload. May be null, in which case appropriate defaults will be used. |
progress | System.IProgress<Google.Apis.Upload.IUploadProgress> Progress reporter for the upload. May be null. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Object | The Google.Apis.Storage.v1.Data.Object representation of the uploaded object. |
UploadObject(String, String, String, Stream, UploadObjectOptions, IProgress<IUploadProgress>)
public override Object UploadObject(string bucket, string objectName, string contentType, Stream source, UploadObjectOptions options = null, IProgress<IUploadProgress> progress = null)
Uploads the data for an object in storage synchronously, from a specified stream.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
contentType | System.String The content type of the object. This should be a MIME type such as "text/html" or "application/octet-stream". May be null. |
source | System.IO.Stream The stream to read the data from. Must not be null. |
options | UploadObjectOptions Additional options for the upload. May be null, in which case appropriate defaults will be used. |
progress | System.IProgress<Google.Apis.Upload.IUploadProgress> Progress reporter for the upload. May be null. |
Returns | |
---|---|
Type | Description |
Google.Apis.Storage.v1.Data.Object | The Google.Apis.Storage.v1.Data.Object representation of the uploaded object. |
UploadObjectAsync(Object, Stream, UploadObjectOptions, CancellationToken, IProgress<IUploadProgress>)
public override Task<Object> UploadObjectAsync(Object destination, Stream source, UploadObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken), IProgress<IUploadProgress> progress = null)
Uploads the data for an object in storage asynchronously, from a specified stream.
Parameters | |
---|---|
Name | Description |
destination | Google.Apis.Storage.v1.Data.Object Object to create or update. Must not be null, and must have the name, bucket and content type populated. |
source | System.IO.Stream The stream to read the data from. Must not be null. |
options | UploadObjectOptions Additional options for the upload. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
progress | System.IProgress<Google.Apis.Upload.IUploadProgress> Progress reporter for the upload. May be null. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Object> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Object representation of the uploaded object. |
UploadObjectAsync(String, String, String, Stream, UploadObjectOptions, CancellationToken, IProgress<IUploadProgress>)
public override Task<Object> UploadObjectAsync(string bucket, string objectName, string contentType, Stream source, UploadObjectOptions options = null, CancellationToken cancellationToken = default(CancellationToken), IProgress<IUploadProgress> progress = null)
Uploads the data for an object in storage asynchronously, from a specified stream.
Parameters | |
---|---|
Name | Description |
bucket | System.String The name of the bucket containing the object. Must not be null. |
objectName | System.String The name of the object within the bucket. Must not be null. |
contentType | System.String The content type of the object. This should be a MIME type such as "text/html" or "application/octet-stream". May be null. |
source | System.IO.Stream The stream to read the data from. Must not be null. |
options | UploadObjectOptions Additional options for the upload. May be null, in which case appropriate defaults will be used. |
cancellationToken | System.Threading.CancellationToken The token to monitor for cancellation requests. |
progress | System.IProgress<Google.Apis.Upload.IUploadProgress> Progress reporter for the upload. May be null. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<Google.Apis.Storage.v1.Data.Object> | A task representing the asynchronous operation, with a result returning the Google.Apis.Storage.v1.Data.Object representation of the uploaded object. |