#[non_exhaustive]pub struct Bucket {Show 32 fields
pub name: String,
pub bucket_id: String,
pub etag: String,
pub project: String,
pub metageneration: i64,
pub location: String,
pub location_type: String,
pub storage_class: String,
pub rpo: String,
pub acl: Vec<BucketAccessControl>,
pub default_object_acl: Vec<ObjectAccessControl>,
pub lifecycle: Option<Lifecycle>,
pub create_time: Option<Timestamp>,
pub cors: Vec<Cors>,
pub update_time: Option<Timestamp>,
pub default_event_based_hold: bool,
pub labels: HashMap<String, String>,
pub website: Option<Website>,
pub versioning: Option<Versioning>,
pub logging: Option<Logging>,
pub owner: Option<Owner>,
pub encryption: Option<Encryption>,
pub billing: Option<Billing>,
pub retention_policy: Option<RetentionPolicy>,
pub iam_config: Option<IamConfig>,
pub satisfies_pzs: bool,
pub custom_placement_config: Option<CustomPlacementConfig>,
pub autoclass: Option<Autoclass>,
pub hierarchical_namespace: Option<HierarchicalNamespace>,
pub soft_delete_policy: Option<SoftDeletePolicy>,
pub object_retention: Option<ObjectRetention>,
pub ip_filter: Option<IpFilter>,
/* private fields */
}Expand description
A bucket.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. The name of the bucket.
Format: projects/{project}/buckets/{bucket}
bucket_id: StringOutput only. The user-chosen part of the bucket name. The {bucket}
portion of the name field. For globally unique buckets, this is equal to
the “bucket name” of other Cloud Storage APIs. Example: “pub”.
etag: StringThe etag of the bucket. If included in the metadata of an UpdateBucketRequest, the operation will only be performed if the etag matches that of the bucket.
project: StringImmutable. The project which owns this bucket, in the format of “projects/{projectIdentifier}”. {projectIdentifier} can be the project ID or project number. Output values will always be in project number format.
metageneration: i64Output only. The metadata generation of this bucket.
location: StringImmutable. The location of the bucket. Object data for objects in the
bucket resides in physical storage within this region. Defaults to US.
See the
[https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations“][developer’s
guide] for the authoritative list. Attempting to update this field after
the bucket is created will result in an error.
location_type: StringOutput only. The location type of the bucket (region, dual-region, multi-region, etc).
storage_class: StringOptional. The bucket’s default storage class, used whenever no storageClass
is specified for a newly-created object. This defines how objects in the
bucket are stored and determines the SLA and the cost of storage.
If this value is not specified when the bucket is created, it will default
to STANDARD. For more information, see
https://developers.google.com/storage/docs/storage-classes.
rpo: StringOptional. The recovery point objective for cross-region replication of the bucket. Applicable only for dual- and multi-region buckets. “DEFAULT” uses default replication. “ASYNC_TURBO” enables turbo replication, valid for dual-region buckets only. If rpo is not specified when the bucket is created, it defaults to “DEFAULT”. For more information, see https://cloud.google.com/storage/docs/availability-durability#turbo-replication.
acl: Vec<BucketAccessControl>Optional. Access controls on the bucket. If iam_config.uniform_bucket_level_access is enabled on this bucket, requests to set, read, or modify acl is an error.
default_object_acl: Vec<ObjectAccessControl>Optional. Default access controls to apply to new objects when no ACL is provided. If iam_config.uniform_bucket_level_access is enabled on this bucket, requests to set, read, or modify acl is an error.
lifecycle: Option<Lifecycle>Optional. The bucket’s lifecycle config. See [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management] for more information.
create_time: Option<Timestamp>Output only. The creation time of the bucket.
cors: Vec<Cors>Optional. The bucket’s [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing] (CORS) config.
update_time: Option<Timestamp>Output only. The modification time of the bucket.
default_event_based_hold: boolOptional. The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold’s release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed.
labels: HashMap<String, String>Optional. User-provided labels, in key/value pairs.
website: Option<Website>Optional. The bucket’s website config, controlling how the service behaves when accessing bucket contents as a web site. See the [https://cloud.google.com/storage/docs/static-website][Static Website Examples] for more information.
versioning: Option<Versioning>Optional. The bucket’s versioning config.
logging: Option<Logging>Optional. The bucket’s logging config, which defines the destination bucket and name prefix (if any) for the current bucket’s logs.
owner: Option<Owner>Output only. The owner of the bucket. This is always the project team’s owner group.
encryption: Option<Encryption>Optional. Encryption config for a bucket.
billing: Option<Billing>Optional. The bucket’s billing config.
retention_policy: Option<RetentionPolicy>Optional. The bucket’s retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.
iam_config: Option<IamConfig>Optional. The bucket’s IAM config.
satisfies_pzs: boolOptional. Reserved for future use.
custom_placement_config: Option<CustomPlacementConfig>Optional. Configuration that, if present, specifies the data placement for a [https://cloud.google.com/storage/docs/locations#location-dr][configurable dual-region].
autoclass: Option<Autoclass>Optional. The bucket’s Autoclass configuration. If there is no configuration, the Autoclass feature will be disabled and have no effect on the bucket.
hierarchical_namespace: Option<HierarchicalNamespace>Optional. The bucket’s hierarchical namespace configuration. If there is no configuration, the hierarchical namespace feature will be disabled and have no effect on the bucket.
soft_delete_policy: Option<SoftDeletePolicy>Optional. The bucket’s soft delete policy. The soft delete policy prevents soft-deleted objects from being permanently deleted.
object_retention: Option<ObjectRetention>Optional. The bucket’s object retention configuration. Must be enabled before objects in the bucket may have retention configured.
ip_filter: Option<IpFilter>Optional. The bucket’s IP filter configuration.
Implementations§
Source§impl Bucket
impl Bucket
pub fn new() -> Self
Sourcepub fn set_bucket_id<T: Into<String>>(self, v: T) -> Self
pub fn set_bucket_id<T: Into<String>>(self, v: T) -> Self
Sets the value of bucket_id.
Sourcepub fn set_project<T: Into<String>>(self, v: T) -> Self
pub fn set_project<T: Into<String>>(self, v: T) -> Self
Sets the value of project.
Sourcepub fn set_metageneration<T: Into<i64>>(self, v: T) -> Self
pub fn set_metageneration<T: Into<i64>>(self, v: T) -> Self
Sets the value of metageneration.
Sourcepub fn set_location<T: Into<String>>(self, v: T) -> Self
pub fn set_location<T: Into<String>>(self, v: T) -> Self
Sets the value of location.
Sourcepub fn set_location_type<T: Into<String>>(self, v: T) -> Self
pub fn set_location_type<T: Into<String>>(self, v: T) -> Self
Sets the value of location_type.
Sourcepub fn set_storage_class<T: Into<String>>(self, v: T) -> Self
pub fn set_storage_class<T: Into<String>>(self, v: T) -> Self
Sets the value of storage_class.
Sourcepub fn set_default_object_acl<T, V>(self, v: T) -> Self
pub fn set_default_object_acl<T, V>(self, v: T) -> Self
Sets the value of default_object_acl.
Sourcepub fn set_lifecycle<T>(self, v: T) -> Self
pub fn set_lifecycle<T>(self, v: T) -> Self
Sets the value of lifecycle.
Sourcepub fn set_or_clear_lifecycle<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_lifecycle<T>(self, v: Option<T>) -> Self
Sets or clears the value of lifecycle.
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
Sourcepub fn set_default_event_based_hold<T: Into<bool>>(self, v: T) -> Self
pub fn set_default_event_based_hold<T: Into<bool>>(self, v: T) -> Self
Sets the value of default_event_based_hold.
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sets the value of labels.
Sourcepub fn set_website<T>(self, v: T) -> Self
pub fn set_website<T>(self, v: T) -> Self
Sets the value of website.
Sourcepub fn set_or_clear_website<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_website<T>(self, v: Option<T>) -> Self
Sets or clears the value of website.
Sourcepub fn set_versioning<T>(self, v: T) -> Selfwhere
T: Into<Versioning>,
pub fn set_versioning<T>(self, v: T) -> Selfwhere
T: Into<Versioning>,
Sets the value of versioning.
Sourcepub fn set_or_clear_versioning<T>(self, v: Option<T>) -> Selfwhere
T: Into<Versioning>,
pub fn set_or_clear_versioning<T>(self, v: Option<T>) -> Selfwhere
T: Into<Versioning>,
Sets or clears the value of versioning.
Sourcepub fn set_logging<T>(self, v: T) -> Self
pub fn set_logging<T>(self, v: T) -> Self
Sets the value of logging.
Sourcepub fn set_or_clear_logging<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_logging<T>(self, v: Option<T>) -> Self
Sets or clears the value of logging.
Sourcepub fn set_or_clear_owner<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_owner<T>(self, v: Option<T>) -> Self
Sets or clears the value of owner.
Sourcepub fn set_encryption<T>(self, v: T) -> Selfwhere
T: Into<Encryption>,
pub fn set_encryption<T>(self, v: T) -> Selfwhere
T: Into<Encryption>,
Sets the value of encryption.
Sourcepub fn set_or_clear_encryption<T>(self, v: Option<T>) -> Selfwhere
T: Into<Encryption>,
pub fn set_or_clear_encryption<T>(self, v: Option<T>) -> Selfwhere
T: Into<Encryption>,
Sets or clears the value of encryption.
Sourcepub fn set_billing<T>(self, v: T) -> Self
pub fn set_billing<T>(self, v: T) -> Self
Sets the value of billing.
Sourcepub fn set_or_clear_billing<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_billing<T>(self, v: Option<T>) -> Self
Sets or clears the value of billing.
Sourcepub fn set_retention_policy<T>(self, v: T) -> Selfwhere
T: Into<RetentionPolicy>,
pub fn set_retention_policy<T>(self, v: T) -> Selfwhere
T: Into<RetentionPolicy>,
Sets the value of retention_policy.
Sourcepub fn set_or_clear_retention_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<RetentionPolicy>,
pub fn set_or_clear_retention_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<RetentionPolicy>,
Sets or clears the value of retention_policy.
Sourcepub fn set_iam_config<T>(self, v: T) -> Self
pub fn set_iam_config<T>(self, v: T) -> Self
Sets the value of iam_config.
Sourcepub fn set_or_clear_iam_config<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_iam_config<T>(self, v: Option<T>) -> Self
Sets or clears the value of iam_config.
Sourcepub fn set_satisfies_pzs<T: Into<bool>>(self, v: T) -> Self
pub fn set_satisfies_pzs<T: Into<bool>>(self, v: T) -> Self
Sets the value of satisfies_pzs.
Sourcepub fn set_custom_placement_config<T>(self, v: T) -> Selfwhere
T: Into<CustomPlacementConfig>,
pub fn set_custom_placement_config<T>(self, v: T) -> Selfwhere
T: Into<CustomPlacementConfig>,
Sets the value of custom_placement_config.
Sourcepub fn set_or_clear_custom_placement_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomPlacementConfig>,
pub fn set_or_clear_custom_placement_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomPlacementConfig>,
Sets or clears the value of custom_placement_config.
Sourcepub fn set_autoclass<T>(self, v: T) -> Self
pub fn set_autoclass<T>(self, v: T) -> Self
Sets the value of autoclass.
Sourcepub fn set_or_clear_autoclass<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_autoclass<T>(self, v: Option<T>) -> Self
Sets or clears the value of autoclass.
Sourcepub fn set_hierarchical_namespace<T>(self, v: T) -> Selfwhere
T: Into<HierarchicalNamespace>,
pub fn set_hierarchical_namespace<T>(self, v: T) -> Selfwhere
T: Into<HierarchicalNamespace>,
Sets the value of hierarchical_namespace.
Sourcepub fn set_or_clear_hierarchical_namespace<T>(self, v: Option<T>) -> Selfwhere
T: Into<HierarchicalNamespace>,
pub fn set_or_clear_hierarchical_namespace<T>(self, v: Option<T>) -> Selfwhere
T: Into<HierarchicalNamespace>,
Sets or clears the value of hierarchical_namespace.
Sourcepub fn set_soft_delete_policy<T>(self, v: T) -> Selfwhere
T: Into<SoftDeletePolicy>,
pub fn set_soft_delete_policy<T>(self, v: T) -> Selfwhere
T: Into<SoftDeletePolicy>,
Sets the value of soft_delete_policy.
Sourcepub fn set_or_clear_soft_delete_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<SoftDeletePolicy>,
pub fn set_or_clear_soft_delete_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<SoftDeletePolicy>,
Sets or clears the value of soft_delete_policy.
Sourcepub fn set_object_retention<T>(self, v: T) -> Selfwhere
T: Into<ObjectRetention>,
pub fn set_object_retention<T>(self, v: T) -> Selfwhere
T: Into<ObjectRetention>,
Sets the value of object_retention.
Sourcepub fn set_or_clear_object_retention<T>(self, v: Option<T>) -> Selfwhere
T: Into<ObjectRetention>,
pub fn set_or_clear_object_retention<T>(self, v: Option<T>) -> Selfwhere
T: Into<ObjectRetention>,
Sets or clears the value of object_retention.
Sourcepub fn set_ip_filter<T>(self, v: T) -> Self
pub fn set_ip_filter<T>(self, v: T) -> Self
Sets the value of ip_filter.
Trait Implementations§
impl StructuralPartialEq for Bucket
Auto Trait Implementations§
impl Freeze for Bucket
impl RefUnwindSafe for Bucket
impl Send for Bucket
impl Sync for Bucket
impl Unpin for Bucket
impl UnwindSafe for Bucket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request