Struct google_api_proto::google::storage::v2::Object

source ·
pub struct Object {
Show 29 fields pub name: String, pub bucket: String, pub etag: String, pub generation: i64, 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 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: BTreeMap<String, String>, 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>,
}
Expand description

An object.

Fields§

§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

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

§generation: i64

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

§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

Storage class of the object.

§size: i64

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

§content_encoding: String

Content-Encoding of the object data, matching [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]

§content_disposition: String

Content-Disposition of the object data, matching [https://tools.ietf.org/html/rfc6266][RFC 6266].

§cache_control: String

Cache-Control directive for the object data, matching [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2]. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

§acl: Vec<ObjectAccessControl>

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

Content-Language of the object data, matching [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][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.

§content_type: String

Content-Type of the object data, matching [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][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 will be silently ignored if provided in requests.

§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

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 will be set to time_created.

§temporary_hold: bool

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>

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: BTreeMap<String, String>

User-provided metadata, in key/value pairs.

§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 will become subject to any bucket-level retention policy, except that the retention duration will be 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 will always be set to true or false.

§owner: Option<Owner>

Output only. The owner of the object. This will always be the uploader of the object.

§customer_encryption: Option<CustomerEncryption>

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

§custom_time: Option<Timestamp>

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 will be permanently deleted.

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

Implementations§

source§

impl Object

source

pub fn event_based_hold(&self) -> bool

Returns the value of event_based_hold, or the default value if event_based_hold is unset.

Trait Implementations§

source§

impl Clone for Object

source§

fn clone(&self) -> Object

Returns a copy 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() -> Self

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

impl Message for Object

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for Object

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

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

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

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<T> ToOwned for T
where T: Clone,

§

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

§

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

§

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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