Object

Struct Object 

Source
#[non_exhaustive]
pub struct Object {
Show 33 fields pub name: String, pub bucket: String, pub etag: String, pub generation: i64, pub restore_token: Option<String>, pub metageneration: i64, pub storage_class: String, pub size: i64, pub content_encoding: String, pub content_disposition: String, pub cache_control: String, pub acl: Vec<ObjectAccessControl>, pub content_language: String, pub delete_time: Option<Timestamp>, pub finalize_time: Option<Timestamp>, pub content_type: String, pub create_time: Option<Timestamp>, pub component_count: i32, pub checksums: Option<ObjectChecksums>, pub update_time: Option<Timestamp>, pub kms_key: String, pub update_storage_class_time: Option<Timestamp>, pub temporary_hold: bool, pub retention_expire_time: Option<Timestamp>, pub metadata: HashMap<String, String>, pub contexts: Option<ObjectContexts>, pub event_based_hold: Option<bool>, pub owner: Option<Owner>, pub customer_encryption: Option<CustomerEncryption>, pub custom_time: Option<Timestamp>, pub soft_delete_time: Option<Timestamp>, pub hard_delete_time: Option<Timestamp>, pub retention: Option<Retention>, /* private fields */
}
Expand description

An object.

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

Immutable. The name of this object. Nearly any sequence of unicode characters is valid. See Guidelines. Example: test.txt The name field by itself does not uniquely identify a Cloud Storage object. A Cloud Storage object is uniquely identified by the tuple of (bucket, object, generation).

§bucket: String

Immutable. The name of the bucket containing this object.

§etag: String

Optional. The etag of an object. If included in the metadata of an update or delete request message, the operation is only performed if the etag matches that of the live object.

§generation: i64

Immutable. The content generation of this object. Used for object versioning.

§restore_token: Option<String>

Output only. Restore token used to differentiate deleted objects with the same name and generation. This field is output only, and only set for deleted objects in HNS buckets.

§metageneration: i64

Output only. The version of the metadata for this generation of this object. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.

§storage_class: String

Optional. Storage class of the object.

§size: i64

Output only. Content-Length of the object data in bytes, matching [RFC 7230 §3.3.2](https://tools.ietf.org/html/rfc7230#section-3.3.2]).

§content_encoding: String

Optional. Content-Encoding of the object data, matching RFC 7231 §3.1.2.2

§content_disposition: String

Optional. Content-Disposition of the object data, matching RFC 6266.

§cache_control: String

Optional. Cache-Control directive for the object data, matching RFC 7234 §5.2. If omitted, and the object is accessible to all anonymous users, the default is public, max-age=3600.

§acl: Vec<ObjectAccessControl>

Optional. Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

§content_language: String

Optional. Content-Language of the object data, matching RFC 7231 §3.1.3.2.

§delete_time: Option<Timestamp>

Output only. If this object is noncurrent, this is the time when the object became noncurrent.

§finalize_time: Option<Timestamp>

Output only. The time when the object was finalized.

§content_type: String

Optional. Content-Type of the object data, matching RFC 7231 §3.1.1.5. If an object is stored without a Content-Type, it is served as application/octet-stream.

§create_time: Option<Timestamp>

Output only. The creation time of the object.

§component_count: i32

Output only. Number of underlying components that make up this object. Components are accumulated by compose operations.

§checksums: Option<ObjectChecksums>

Output only. Hashes for the data part of this object. This field is used for output only and is silently ignored if provided in requests. The checksums of the complete object regardless of data range. If the object is downloaded in full, the client should compute one of these checksums over the downloaded object and compare it against the value provided here.

§update_time: Option<Timestamp>

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.

§kms_key: String

Optional. Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.

§update_storage_class_time: Option<Timestamp>

Output only. The time at which the object’s storage class was last changed. When the object is initially created, it is set to time_created.

§temporary_hold: bool

Optional. Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.

§retention_expire_time: Option<Timestamp>

Optional. A server-determined value that specifies the earliest time that the object’s retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

§metadata: HashMap<String, String>

Optional. User-provided metadata, in key/value pairs.

§contexts: Option<ObjectContexts>

Optional. User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.

§event_based_hold: Option<bool>

Whether an object is under event-based hold. An event-based hold is a way to force the retention of an object until after some event occurs. Once the hold is released by explicitly setting this field to false, the object becomes subject to any bucket-level retention policy, except that the retention duration is calculated from the time the event based hold was lifted, rather than the time the object was created.

In a WriteObject request, not setting this field implies that the value should be taken from the parent bucket’s default_event_based_hold field. In a response, this field is always set to true or false.

§owner: Option<Owner>

Output only. The owner of the object. This is always the uploader of the object.

§customer_encryption: Option<CustomerEncryption>

Optional. Metadata of customer-supplied encryption key, if the object is encrypted by such a key.

§custom_time: Option<Timestamp>

Optional. A user-specified timestamp set on an object.

§soft_delete_time: Option<Timestamp>

Output only. This is the time when the object became soft-deleted.

Soft-deleted objects are only accessible if a soft_delete_policy is enabled. Also see hard_delete_time.

§hard_delete_time: Option<Timestamp>

Output only. The time when the object is permanently deleted.

Only set when an object becomes soft-deleted with a soft_delete_policy. Otherwise, the object is not accessible.

§retention: Option<Retention>

Optional. Retention configuration of this object. Might only be configured if the bucket has object retention enabled.

Implementations§

Source§

impl Object

Source

pub fn new() -> Self

Source

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

Sets the value of name.

§Example
let x = Object::new().set_name("example");
Source

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

Sets the value of bucket.

§Example
let x = Object::new().set_bucket("example");
Source

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

Sets the value of etag.

§Example
let x = Object::new().set_etag("example");
Source

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

Sets the value of generation.

§Example
let x = Object::new().set_generation(42);
Source

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

Sets the value of restore_token.

§Example
let x = Object::new().set_restore_token("example");
Source

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

Sets or clears the value of restore_token.

§Example
let x = Object::new().set_or_clear_restore_token(Some("example"));
let x = Object::new().set_or_clear_restore_token(None::<String>);
Source

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

Sets the value of metageneration.

§Example
let x = Object::new().set_metageneration(42);
Source

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

Sets the value of storage_class.

§Example
let x = Object::new().set_storage_class("example");
Source

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

Sets the value of size.

§Example
let x = Object::new().set_size(42);
Source

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

Sets the value of content_encoding.

§Example
let x = Object::new().set_content_encoding("example");
Source

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

Sets the value of content_disposition.

§Example
let x = Object::new().set_content_disposition("example");
Source

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

Sets the value of cache_control.

§Example
let x = Object::new().set_cache_control("example");
Source

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

Sets the value of acl.

§Example
use google_cloud_storage::model::ObjectAccessControl;
let x = Object::new()
    .set_acl([
        ObjectAccessControl::default()/* use setters */,
        ObjectAccessControl::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of content_language.

§Example
let x = Object::new().set_content_language("example");
Source

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

Sets the value of delete_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_delete_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of delete_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_delete_time(None::<Timestamp>);
Source

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

Sets the value of finalize_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_finalize_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of finalize_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_finalize_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_finalize_time(None::<Timestamp>);
Source

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

Sets the value of content_type.

§Example
let x = Object::new().set_content_type("example");
Source

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

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_create_time(Timestamp::default()/* use setters */);
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.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_component_count<T: Into<i32>>(self, v: T) -> Self

Sets the value of component_count.

§Example
let x = Object::new().set_component_count(42);
Source

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

Sets the value of checksums.

§Example
use google_cloud_storage::model::ObjectChecksums;
let x = Object::new().set_checksums(ObjectChecksums::default()/* use setters */);
Source

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

Sets or clears the value of checksums.

§Example
use google_cloud_storage::model::ObjectChecksums;
let x = Object::new().set_or_clear_checksums(Some(ObjectChecksums::default()/* use setters */));
let x = Object::new().set_or_clear_checksums(None::<ObjectChecksums>);
Source

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

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_update_time(Timestamp::default()/* use setters */);
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.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_update_time(None::<Timestamp>);
Source

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

Sets the value of kms_key.

§Example
let x = Object::new().set_kms_key("example");
Source

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

Sets the value of update_storage_class_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_update_storage_class_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of update_storage_class_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_update_storage_class_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_update_storage_class_time(None::<Timestamp>);
Source

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

Sets the value of temporary_hold.

§Example
let x = Object::new().set_temporary_hold(true);
Source

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

Sets the value of retention_expire_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_retention_expire_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of retention_expire_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_retention_expire_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_retention_expire_time(None::<Timestamp>);
Source

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

Sets the value of metadata.

§Example
let x = Object::new().set_metadata([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_contexts<T>(self, v: T) -> Self
where T: Into<ObjectContexts>,

Sets the value of contexts.

§Example
use google_cloud_storage::model::ObjectContexts;
let x = Object::new().set_contexts(ObjectContexts::default()/* use setters */);
Source

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

Sets or clears the value of contexts.

§Example
use google_cloud_storage::model::ObjectContexts;
let x = Object::new().set_or_clear_contexts(Some(ObjectContexts::default()/* use setters */));
let x = Object::new().set_or_clear_contexts(None::<ObjectContexts>);
Source

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

Sets the value of event_based_hold.

§Example
let x = Object::new().set_event_based_hold(true);
Source

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

Sets or clears the value of event_based_hold.

§Example
let x = Object::new().set_or_clear_event_based_hold(Some(false));
let x = Object::new().set_or_clear_event_based_hold(None::<bool>);
Source

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

Sets the value of owner.

§Example
use google_cloud_storage::model::Owner;
let x = Object::new().set_owner(Owner::default()/* use setters */);
Source

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

Sets or clears the value of owner.

§Example
use google_cloud_storage::model::Owner;
let x = Object::new().set_or_clear_owner(Some(Owner::default()/* use setters */));
let x = Object::new().set_or_clear_owner(None::<Owner>);
Source

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

Sets the value of customer_encryption.

§Example
use google_cloud_storage::model::CustomerEncryption;
let x = Object::new().set_customer_encryption(CustomerEncryption::default()/* use setters */);
Source

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

Sets or clears the value of customer_encryption.

§Example
use google_cloud_storage::model::CustomerEncryption;
let x = Object::new().set_or_clear_customer_encryption(Some(CustomerEncryption::default()/* use setters */));
let x = Object::new().set_or_clear_customer_encryption(None::<CustomerEncryption>);
Source

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

Sets the value of custom_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_custom_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of custom_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_custom_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_custom_time(None::<Timestamp>);
Source

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

Sets the value of soft_delete_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_soft_delete_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of soft_delete_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_soft_delete_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_soft_delete_time(None::<Timestamp>);
Source

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

Sets the value of hard_delete_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_hard_delete_time(Timestamp::default()/* use setters */);
Source

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

Sets or clears the value of hard_delete_time.

§Example
use wkt::Timestamp;
let x = Object::new().set_or_clear_hard_delete_time(Some(Timestamp::default()/* use setters */));
let x = Object::new().set_or_clear_hard_delete_time(None::<Timestamp>);
Source

pub fn set_retention<T>(self, v: T) -> Self
where T: Into<Retention>,

Sets the value of retention.

§Example
use google_cloud_storage::model::object::Retention;
let x = Object::new().set_retention(Retention::default()/* use setters */);
Source

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

Sets or clears the value of retention.

§Example
use google_cloud_storage::model::object::Retention;
let x = Object::new().set_or_clear_retention(Some(Retention::default()/* use setters */));
let x = Object::new().set_or_clear_retention(None::<Retention>);

Trait Implementations§

Source§

impl Clone for Object

Source§

fn clone(&self) -> Object

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 Object

Source§

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

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

impl Default for Object

Source§

fn default() -> Object

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

impl Message for Object

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Object

Source§

fn eq(&self, other: &Object) -> 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 Object

Auto Trait Implementations§

§

impl !Freeze for Object

§

impl RefUnwindSafe for Object

§

impl Send for Object

§

impl Sync for Object

§

impl Unpin for Object

§

impl UnwindSafe for Object

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>,