Bucket

Struct Bucket 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Identifier. The name of the bucket. Format: projects/{project}/buckets/{bucket}

§bucket_id: String

Output 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: String

The 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: String

Immutable. 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: i64

Output only. The metadata generation of this bucket.

§location: String

Immutable. 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: String

Output only. The location type of the bucket (region, dual-region, multi-region, etc).

§storage_class: String

Optional. 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: String

Optional. 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: bool

Optional. 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: bool

Optional. 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

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

Source

pub fn set_bucket_id<T: Into<String>>(self, v: T) -> Self

Sets the value of bucket_id.

Source

pub fn set_etag<T: Into<String>>(self, v: T) -> Self

Sets the value of etag.

Source

pub fn set_project<T: Into<String>>(self, v: T) -> Self

Sets the value of project.

Source

pub fn set_metageneration<T: Into<i64>>(self, v: T) -> Self

Sets the value of metageneration.

Source

pub fn set_location<T: Into<String>>(self, v: T) -> Self

Sets the value of location.

Source

pub fn set_location_type<T: Into<String>>(self, v: T) -> Self

Sets the value of location_type.

Source

pub fn set_storage_class<T: Into<String>>(self, v: T) -> Self

Sets the value of storage_class.

Source

pub fn set_rpo<T: Into<String>>(self, v: T) -> Self

Sets the value of rpo.

Source

pub fn set_acl<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<BucketAccessControl>,

Sets the value of acl.

Source

pub fn set_default_object_acl<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<ObjectAccessControl>,

Sets the value of default_object_acl.

Source

pub fn set_lifecycle<T>(self, v: T) -> Self
where T: Into<Lifecycle>,

Sets the value of lifecycle.

Source

pub fn set_or_clear_lifecycle<T>(self, v: Option<T>) -> Self
where T: Into<Lifecycle>,

Sets or clears the value of lifecycle.

Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

Source

pub fn set_cors<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Cors>,

Sets the value of cors.

Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of update_time.

Source

pub fn set_default_event_based_hold<T: Into<bool>>(self, v: T) -> Self

Sets the value of default_event_based_hold.

Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

Source

pub fn set_website<T>(self, v: T) -> Self
where T: Into<Website>,

Sets the value of website.

Source

pub fn set_or_clear_website<T>(self, v: Option<T>) -> Self
where T: Into<Website>,

Sets or clears the value of website.

Source

pub fn set_versioning<T>(self, v: T) -> Self
where T: Into<Versioning>,

Sets the value of versioning.

Source

pub fn set_or_clear_versioning<T>(self, v: Option<T>) -> Self
where T: Into<Versioning>,

Sets or clears the value of versioning.

Source

pub fn set_logging<T>(self, v: T) -> Self
where T: Into<Logging>,

Sets the value of logging.

Source

pub fn set_or_clear_logging<T>(self, v: Option<T>) -> Self
where T: Into<Logging>,

Sets or clears the value of logging.

Source

pub fn set_owner<T>(self, v: T) -> Self
where T: Into<Owner>,

Sets the value of owner.

Source

pub fn set_or_clear_owner<T>(self, v: Option<T>) -> Self
where T: Into<Owner>,

Sets or clears the value of owner.

Source

pub fn set_encryption<T>(self, v: T) -> Self
where T: Into<Encryption>,

Sets the value of encryption.

Source

pub fn set_or_clear_encryption<T>(self, v: Option<T>) -> Self
where T: Into<Encryption>,

Sets or clears the value of encryption.

Source

pub fn set_billing<T>(self, v: T) -> Self
where T: Into<Billing>,

Sets the value of billing.

Source

pub fn set_or_clear_billing<T>(self, v: Option<T>) -> Self
where T: Into<Billing>,

Sets or clears the value of billing.

Source

pub fn set_retention_policy<T>(self, v: T) -> Self

Sets the value of retention_policy.

Source

pub fn set_or_clear_retention_policy<T>(self, v: Option<T>) -> Self

Sets or clears the value of retention_policy.

Source

pub fn set_iam_config<T>(self, v: T) -> Self
where T: Into<IamConfig>,

Sets the value of iam_config.

Source

pub fn set_or_clear_iam_config<T>(self, v: Option<T>) -> Self
where T: Into<IamConfig>,

Sets or clears the value of iam_config.

Source

pub fn set_satisfies_pzs<T: Into<bool>>(self, v: T) -> Self

Sets the value of satisfies_pzs.

Source

pub fn set_custom_placement_config<T>(self, v: T) -> Self

Sets the value of custom_placement_config.

Source

pub fn set_or_clear_custom_placement_config<T>(self, v: Option<T>) -> Self

Sets or clears the value of custom_placement_config.

Source

pub fn set_autoclass<T>(self, v: T) -> Self
where T: Into<Autoclass>,

Sets the value of autoclass.

Source

pub fn set_or_clear_autoclass<T>(self, v: Option<T>) -> Self
where T: Into<Autoclass>,

Sets or clears the value of autoclass.

Source

pub fn set_hierarchical_namespace<T>(self, v: T) -> Self

Sets the value of hierarchical_namespace.

Source

pub fn set_or_clear_hierarchical_namespace<T>(self, v: Option<T>) -> Self

Sets or clears the value of hierarchical_namespace.

Source

pub fn set_soft_delete_policy<T>(self, v: T) -> Self

Sets the value of soft_delete_policy.

Source

pub fn set_or_clear_soft_delete_policy<T>(self, v: Option<T>) -> Self

Sets or clears the value of soft_delete_policy.

Source

pub fn set_object_retention<T>(self, v: T) -> Self

Sets the value of object_retention.

Source

pub fn set_or_clear_object_retention<T>(self, v: Option<T>) -> Self

Sets or clears the value of object_retention.

Source

pub fn set_ip_filter<T>(self, v: T) -> Self
where T: Into<IpFilter>,

Sets the value of ip_filter.

Source

pub fn set_or_clear_ip_filter<T>(self, v: Option<T>) -> Self
where T: Into<IpFilter>,

Sets or clears the value of ip_filter.

Trait Implementations§

Source§

impl Clone for Bucket

Source§

fn clone(&self) -> Bucket

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Bucket

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Bucket

Source§

fn default() -> Bucket

Returns the “default value” for a type. Read more
Source§

impl Message for Bucket

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Bucket

Source§

fn eq(&self, other: &Bucket) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,