Google Cloud Storage C++ Client
1.42.0
A C++ Client Library for Google Cloud Storage
|
Represents the metadata for a Google Cloud Storage Object. More...
#include <google/cloud/storage/object_metadata.h>
Public Member Functions | |
ObjectMetadata ()=default | |
std::vector< ObjectAccessControl > const & | acl () const |
The access control list for this object. More... | |
std::vector< ObjectAccessControl > & | mutable_acl () |
The access control list for this object. More... | |
ObjectMetadata & | set_acl (std::vector< ObjectAccessControl > acl) |
Change the access control list. More... | |
std::string const & | bucket () const |
The name of the bucket containing this object. More... | |
std::string const & | cache_control () const |
The cacheControl attribute. More... | |
ObjectMetadata & | set_cache_control (std::string cache_control) |
Set the cacheControl attribute. More... | |
std::int32_t | component_count () const |
The number of components, for objects built using ComposeObject() . More... | |
std::string | content_disposition () const |
The contentDisposition attribute. More... | |
ObjectMetadata & | set_content_disposition (std::string value) |
Change the contentDisposition attribute. More... | |
std::string | content_encoding () const |
The contentEncoding attribute. More... | |
ObjectMetadata & | set_content_encoding (std::string value) |
Change the contentEncoding attribute. More... | |
std::string | content_language () const |
The contentLanguage attribute. More... | |
ObjectMetadata & | set_content_language (std::string value) |
Change the contentLanguage attribute. More... | |
std::string | content_type () const |
The contentType attribute. More... | |
ObjectMetadata & | set_content_type (std::string value) |
Change the contentLanguage attribute. More... | |
std::string const & | crc32c () const |
The CRC32C checksum for the object contents. More... | |
bool | has_customer_encryption () const |
Returns true if the object uses CSEK (Customer-Supplied Encryption Keys). More... | |
CustomerEncryption const & | customer_encryption () const |
Returns the CSEK metadata (algorithm and key SHA256). More... | |
bool | event_based_hold () const |
The eventBasedHold attribute. More... | |
ObjectMetadata & | set_event_based_hold (bool v) |
Changes the eventBasedHold attribute. More... | |
std::int64_t | generation () const |
The object generation. More... | |
std::string const & | kms_key_name () const |
The name of the KMS (Key Management Service) key used in this object. More... | |
std::string const & | md5_hash () const |
The MD5 hash of the object contents. Can be empty. More... | |
std::string const & | media_link () const |
The HTTPS link to access the object contents. More... | |
std::chrono::system_clock::time_point | retention_expiration_time () const |
The retention expiration time, or the system clock's epoch, if not set. More... | |
std::uint64_t | size () const |
The size of the object's data. More... | |
ObjectMetadata & | set_storage_class (std::string v) |
Changes the storageClass attribute. More... | |
bool | temporary_hold () const |
The temporaryHold attribute. More... | |
ObjectMetadata & | set_temporary_hold (bool v) |
Changes the temporaryHold attribute. More... | |
std::chrono::system_clock::time_point | time_deleted () const |
The object's deletion timestamp. More... | |
std::chrono::system_clock::time_point | time_storage_class_updated () const |
The timestamp for the last storage class change. More... | |
bool | has_custom_time () const |
Returns true if the object has a customTime attribute. More... | |
std::chrono::system_clock::time_point | custom_time () const |
Returns the object's customTime or the system clock's epoch. More... | |
ObjectMetadata & | set_custom_time (std::chrono::system_clock::time_point v) |
Changes the customTime attribute. More... | |
ObjectMetadata & | reset_custom_time () |
Reset (clears) the customTime attribute. More... | |
Accessors and modifiers for metadata entries. | |
The object metadata contains a user-defined set of Applications can use these fields to add custom annotations to each object. | |
bool | has_metadata (std::string const &key) const |
std::string const & | metadata (std::string const &key) const |
Returns the value of key in the Object's metadata entries. More... | |
ObjectMetadata & | delete_metadata (std::string const &key) |
Delete a metadata entry. This is a no-op if the key does not exist. More... | |
ObjectMetadata & | upsert_metadata (std::string key, std::string value) |
Insert or update the metadata entry. More... | |
std::map< std::string, std::string > const & | metadata () const |
Returns all the Object's metadata entries. More... | |
std::map< std::string, std::string > & | mutable_metadata () |
Returns all the Object's metadata entries. More... | |
Friends | |
bool | operator== (ObjectMetadata const &lhs, ObjectMetadata const &rhs) |
bool | operator!= (ObjectMetadata const &lhs, ObjectMetadata const &rhs) |
std::ostream & | operator<< (std::ostream &os, ObjectMetadata const &rhs) |
Represents the metadata for a Google Cloud Storage Object.
Note that all modifiers just change the local representation of the Object's metadata. Applications should use Client::PatchObject()
, or a similar operation, to actually modify the metadata stored by GCS.
Definition at line 99 of file object_metadata.h.
|
default |
|
inline |
The access control list for this object.
Definition at line 107 of file object_metadata.h.
|
inline |
The name of the bucket containing this object.
Definition at line 119 of file object_metadata.h.
|
inline |
The cacheControl
attribute.
Definition at line 122 of file object_metadata.h.
|
inline |
The number of components, for objects built using ComposeObject()
.
Definition at line 131 of file object_metadata.h.
|
inline |
The contentDisposition
attribute.
Definition at line 134 of file object_metadata.h.
|
inline |
The contentEncoding
attribute.
Definition at line 143 of file object_metadata.h.
|
inline |
The contentLanguage
attribute.
Definition at line 152 of file object_metadata.h.
|
inline |
The contentType
attribute.
Definition at line 161 of file object_metadata.h.
|
inline |
The CRC32C
checksum for the object contents.
Definition at line 170 of file object_metadata.h.
|
inline |
Returns the object's customTime
or the system clock's epoch.
Definition at line 354 of file object_metadata.h.
|
inline |
Returns the CSEK metadata (algorithm and key SHA256).
It is undefined behavior to call this member function if has_customer_encryption() == false
.
Definition at line 184 of file object_metadata.h.
|
inline |
Delete a metadata entry. This is a no-op if the key does not exist.
Definition at line 253 of file object_metadata.h.
|
inline |
The eventBasedHold
attribute.
Definition at line 192 of file object_metadata.h.
|
inline |
The object generation.
In buckets with object versioning enabled, each object may have multiple generations. Each generation data (the object contents) is immutable, but the metadata associated with each generation can be changed.
Definition at line 207 of file object_metadata.h.
|
inline |
Returns true
if the object has a customTime
attribute.
Definition at line 351 of file object_metadata.h.
|
inline |
Returns true
if the object uses CSEK (Customer-Supplied Encryption Keys).
Definition at line 174 of file object_metadata.h.
|
inline |
Returns true
if the key is present in the object metadata entries.
Definition at line 238 of file object_metadata.h.
|
inline |
The name of the KMS (Key Management Service) key used in this object.
This is empty for objects not using CMEK (Customer Managed Encryption Keys).
Definition at line 221 of file object_metadata.h.
|
inline |
The MD5 hash of the object contents. Can be empty.
Definition at line 224 of file object_metadata.h.
|
inline |
The HTTPS link to access the object contents.
Definition at line 227 of file object_metadata.h.
|
inline |
Returns all the Object's metadata entries.
Definition at line 274 of file object_metadata.h.
|
inline |
Returns the value of key
in the Object's metadata entries.
It is undefined behavior to call metadata(key)
if has_metadata(key) == false
.
Definition at line 248 of file object_metadata.h.
|
inline |
The access control list for this object.
Definition at line 110 of file object_metadata.h.
|
inline |
Returns all the Object's metadata entries.
Definition at line 279 of file object_metadata.h.
|
inline |
Reset (clears) the customTime
attribute.
has_custom_time()
returns false
after calling this function.
Definition at line 366 of file object_metadata.h.
|
inline |
The retention expiration time, or the system clock's epoch, if not set.
Definition at line 306 of file object_metadata.h.
|
inline |
Change the access control list.
Definition at line 113 of file object_metadata.h.
|
inline |
Set the cacheControl
attribute.
Definition at line 125 of file object_metadata.h.
|
inline |
Change the contentDisposition
attribute.
Definition at line 137 of file object_metadata.h.
|
inline |
Change the contentEncoding
attribute.
Definition at line 146 of file object_metadata.h.
|
inline |
Change the contentLanguage
attribute.
Definition at line 155 of file object_metadata.h.
|
inline |
Change the contentLanguage
attribute.
Definition at line 164 of file object_metadata.h.
|
inline |
Changes the customTime
attribute.
Definition at line 359 of file object_metadata.h.
|
inline |
Changes the eventBasedHold
attribute.
Definition at line 195 of file object_metadata.h.
|
inline |
Changes the storageClass
attribute.
Definition at line 320 of file object_metadata.h.
|
inline |
Changes the temporaryHold
attribute.
Definition at line 329 of file object_metadata.h.
|
inline |
The size of the object's data.
Definition at line 314 of file object_metadata.h.
|
inline |
The temporaryHold
attribute.
Definition at line 326 of file object_metadata.h.
|
inline |
The object's deletion timestamp.
Definition at line 338 of file object_metadata.h.
|
inline |
The timestamp for the last storage class change.
Definition at line 343 of file object_metadata.h.
|
inline |
Insert or update the metadata entry.
Definition at line 263 of file object_metadata.h.
|
friend |
Definition at line 372 of file object_metadata.h.
|
friend |
|
friend |