Google Cloud Storage C++ Client  2.5.0
A C++ Client Library for Google Cloud Storage
Public Member Functions | Friends | List of all members
google::cloud::storage::BucketMetadata Class Reference

Represents a Google Cloud Storage Bucket Metadata object. More...

#include <google/cloud/storage/bucket_metadata.h>

Public Member Functions

 BucketMetadata ()=default
 
std::string const & etag () const
 
BucketMetadataset_etag (std::string v)
 
std::string const & id () const
 Return the bucket id. More...
 
BucketMetadataset_id (std::string v)
 
std::string const & kind () const
 
BucketMetadataset_kind (std::string v)
 
std::string const & location () const
 Return the bucket location. More...
 
BucketMetadataset_location (std::string v)
 Set the bucket location. Only applicable when creating buckets. More...
 
std::string const & location_type () const
 Returns the location type (e.g. regional vs. dual region). More...
 
BucketMetadataset_location_type (std::string v)
 
std::int64_t metageneration () const
 The bucket metageneration. More...
 
BucketMetadataset_metageneration (std::int64_t v)
 
std::string const & name () const
 The bucket name. More...
 
BucketMetadataset_name (std::string v)
 Changes the name. More...
 
bool has_owner () const
 Returns true if the bucket owner attribute is present. More...
 
Owner const & owner () const
 Returns the owner. More...
 
BucketMetadataset_owner (Owner v)
 
BucketMetadatareset_owner ()
 
std::int64_t const & project_number () const
 
BucketMetadataset_project_number (std::int64_t v)
 
std::string const & self_link () const
 Returns a HTTP link to retrieve the bucket metadata. More...
 
BucketMetadataset_self_link (std::string v)
 
std::chrono::system_clock::time_point time_created () const
 Returns the bucket creation timestamp. More...
 
BucketMetadataset_time_created (std::chrono::system_clock::time_point v)
 
std::chrono::system_clock::time_point updated () const
 Returns the timestamp for the last bucket metadata update. More...
 
BucketMetadataset_updated (std::chrono::system_clock::time_point v)
 
Get and set Bucket Access Control Lists.
std::vector< BucketAccessControl > const & acl () const
 
std::vector< BucketAccessControl > & mutable_acl ()
 
BucketMetadataset_acl (std::vector< BucketAccessControl > acl)
 
Accessors and modifiers for Autoclass configuration.
bool has_autoclass () const
 
BucketAutoclass const & autoclass () const
 
absl::optional< BucketAutoclass > const & autoclass_as_optional () const
 
BucketMetadataset_autoclass (BucketAutoclass v)
 
BucketMetadatareset_autoclass ()
 
Get and set billing configuration for the Bucket.
bool has_billing () const
 
BucketBilling const & billing () const
 
absl::optional< BucketBilling > const & billing_as_optional () const
 
BucketMetadataset_billing (BucketBilling const &v)
 
BucketMetadatareset_billing ()
 
Get and set the default event based hold for the Bucket.

Objects may have an event-based hold associated with them.

If a Bucket has the default_event_based_hold() parameter set, and you create a new object in the bucket without specifying its event-event based hold then the object gets the value set in the bucket.

See also
https://cloud.google.com/storage/docs/bucket-lock for generation information on retention policies. The section on Object holds is particularly relevant.
https://cloud.google.com/storage/docs/holding-objects for examples of using default event-based hold policy.
bool default_event_based_hold () const
 
BucketMetadataset_default_event_based_hold (bool v)
 
Get and set CORS configuration for the Bucket.
See also
https://en.wikipedia.org/wiki/Cross-origin_resource_sharing for general information on CORS.
https://cloud.google.com/storage/docs/cross-origin for general information about CORS in the context of Google Cloud Storage.
https://cloud.google.com/storage/docs/configuring-cors for information on how to set and troubleshoot CORS settings.
std::vector< CorsEntry > const & cors () const
 
std::vector< CorsEntry > & mutable_cors ()
 
BucketMetadataset_cors (std::vector< CorsEntry > cors)
 
Get and set the Default Object Access Control Lists.
See also
https://cloud.google.com/storage/docs/access-control/lists#default for general information of default ACLs.
https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.
std::vector< ObjectAccessControl > const & default_acl () const
 
std::vector< ObjectAccessControl > & mutable_default_acl ()
 
BucketMetadataset_default_acl (std::vector< ObjectAccessControl > acl)
 
bool has_encryption () const
 
BucketEncryption const & encryption () const
 
absl::optional< BucketEncryption > const & encryption_as_optional () const
 
BucketMetadataset_encryption (BucketEncryption v)
 
BucketMetadatareset_encryption ()
 
Get and set the IAM configuration.
See also
Before enabling Uniform Bucket Level Access please review the feature documentation, as well as "Should you use uniform bucket-level access ?".
bool has_iam_configuration () const
 
BucketIamConfiguration const & iam_configuration () const
 
absl::optional< BucketIamConfiguration > const & iam_configuration_as_optional () const
 
BucketMetadataset_iam_configuration (BucketIamConfiguration v)
 
BucketMetadatareset_iam_configuration ()
 
Accessors and modifiers to the <tt>labels</tt>.
bool has_label (std::string const &key) const
 Returns true if the key is present in the Bucket's metadata labels. More...
 
std::string const & label (std::string const &key) const
 Returns the value of key in the Bucket's metadata labels. More...
 
BucketMetadatadelete_label (std::string const &key)
 Delete a label. This is a no-op if the key does not exist. More...
 
BucketMetadataupsert_label (std::string key, std::string value)
 Insert or update the label entry. More...
 
std::map< std::string, std::string > const & labels () const
 Returns all the Bucket's labels. More...
 
std::map< std::string, std::string > & mutable_labels ()
 Returns all the Bucket's labels. More...
 
Accessors and modifiers for object lifecycle rules.
See also
https://cloud.google.com/storage/docs/managing-lifecycles for general information on object lifecycle rules.
bool has_lifecycle () const
 
BucketLifecycle const & lifecycle () const
 
absl::optional< BucketLifecycle > const & lifecycle_as_optional () const
 
BucketMetadataset_lifecycle (BucketLifecycle v)
 
BucketMetadatareset_lifecycle ()
 
Accessors and modifiers for logging configuration.
bool has_logging () const
 
BucketLogging const & logging () const
 
absl::optional< BucketLogging > const & logging_as_optional () const
 
BucketMetadataset_logging (BucketLogging v)
 
BucketMetadatareset_logging ()
 
Accessors and modifiers for retention policy configuration.
bool has_retention_policy () const
 Sets the retention period. More...
 
BucketRetentionPolicy const & retention_policy () const
 Sets the retention period. More...
 
absl::optional< BucketRetentionPolicy > const & retention_policy_as_optional () const
 Sets the retention period. More...
 
BucketMetadataset_retention_policy (BucketRetentionPolicy v)
 Sets the retention period. More...
 
BucketMetadataset_retention_policy (std::chrono::seconds retention_period)
 Sets the retention period. More...
 
BucketMetadatareset_retention_policy ()
 Sets the retention period. More...
 
Accessors and modifiers for the Recovery Point Objective.
std::string const & rpo () const
 
BucketMetadataset_rpo (std::string v)
 
Access and modify the default storage class attribute.
std::string const & storage_class () const
 
BucketMetadataset_storage_class (std::string v)
 
Accessors and modifiers for versioning configuration.
absl::optional< BucketVersioning > const & versioning () const
 
bool has_versioning () const
 
BucketMetadataenable_versioning ()
 
BucketMetadatadisable_versioning ()
 
BucketMetadatareset_versioning ()
 
BucketMetadataset_versioning (absl::optional< BucketVersioning > v)
 
Accessors and modifiers for website configuration.
bool has_website () const
 
BucketWebsite const & website () const
 
absl::optional< BucketWebsite > const & website_as_optional () const
 
BucketMetadataset_website (BucketWebsite v)
 
BucketMetadatareset_website ()
 
Accessors and modifiers for custom placement configuration.
bool has_custom_placement_config () const
 Placement configuration can only be set when the bucket is created. More...
 
BucketCustomPlacementConfig const & custom_placement_config () const
 Placement configuration can only be set when the bucket is created. More...
 
absl::optional< BucketCustomPlacementConfig > const & custom_placement_config_as_optional () const
 Placement configuration can only be set when the bucket is created. More...
 
BucketMetadataset_custom_placement_config (BucketCustomPlacementConfig v)
 Placement configuration can only be set when the bucket is created. More...
 
BucketMetadatareset_custom_placement_config ()
 Placement configuration can only be set when the bucket is created. More...
 

Friends

bool operator== (BucketMetadata const &lhs, BucketMetadata const &rhs)
 
bool operator!= (BucketMetadata const &lhs, BucketMetadata const &rhs)
 
std::ostream & operator<< (std::ostream &os, BucketMetadata const &rhs)
 

Detailed Description

Represents a Google Cloud Storage Bucket Metadata object.

Definition at line 53 of file bucket_metadata.h.

Constructor & Destructor Documentation

◆ BucketMetadata()

google::cloud::storage::BucketMetadata::BucketMetadata ( )
default

Member Function Documentation

◆ acl()

std::vector<BucketAccessControl> const& google::cloud::storage::BucketMetadata::acl ( ) const
inline

Definition at line 65 of file bucket_metadata.h.

◆ autoclass()

BucketAutoclass const& google::cloud::storage::BucketMetadata::autoclass ( ) const
inline

Definition at line 76 of file bucket_metadata.h.

◆ autoclass_as_optional()

absl::optional<BucketAutoclass> const& google::cloud::storage::BucketMetadata::autoclass_as_optional ( ) const
inline

Definition at line 77 of file bucket_metadata.h.

◆ billing()

BucketBilling const& google::cloud::storage::BucketMetadata::billing ( ) const
inline

Definition at line 97 of file bucket_metadata.h.

◆ billing_as_optional()

absl::optional<BucketBilling> const& google::cloud::storage::BucketMetadata::billing_as_optional ( ) const
inline

Definition at line 98 of file bucket_metadata.h.

◆ cors()

std::vector<CorsEntry> const& google::cloud::storage::BucketMetadata::cors ( ) const
inline

Definition at line 149 of file bucket_metadata.h.

◆ custom_placement_config()

BucketCustomPlacementConfig const& google::cloud::storage::BucketMetadata::custom_placement_config ( ) const
inline

Placement configuration can only be set when the bucket is created.

Definition at line 542 of file bucket_metadata.h.

◆ custom_placement_config_as_optional()

absl::optional<BucketCustomPlacementConfig> const& google::cloud::storage::BucketMetadata::custom_placement_config_as_optional ( ) const
inline

Placement configuration can only be set when the bucket is created.

Definition at line 546 of file bucket_metadata.h.

◆ default_acl()

std::vector<ObjectAccessControl> const& google::cloud::storage::BucketMetadata::default_acl ( ) const
inline

Definition at line 168 of file bucket_metadata.h.

◆ default_event_based_hold()

bool google::cloud::storage::BucketMetadata::default_event_based_hold ( ) const
inline

Definition at line 129 of file bucket_metadata.h.

◆ delete_label()

BucketMetadata& google::cloud::storage::BucketMetadata::delete_label ( std::string const &  key)
inline

Delete a label. This is a no-op if the key does not exist.

Definition at line 280 of file bucket_metadata.h.

◆ disable_versioning()

BucketMetadata& google::cloud::storage::BucketMetadata::disable_versioning ( )
inline

Definition at line 506 of file bucket_metadata.h.

◆ enable_versioning()

BucketMetadata& google::cloud::storage::BucketMetadata::enable_versioning ( )
inline

Definition at line 502 of file bucket_metadata.h.

◆ encryption()

BucketEncryption const& google::cloud::storage::BucketMetadata::encryption ( ) const
inline

Definition at line 192 of file bucket_metadata.h.

◆ encryption_as_optional()

absl::optional<BucketEncryption> const& google::cloud::storage::BucketMetadata::encryption_as_optional ( ) const
inline

Definition at line 193 of file bucket_metadata.h.

◆ etag()

std::string const& google::cloud::storage::BucketMetadata::etag ( ) const
inline

Definition at line 206 of file bucket_metadata.h.

◆ has_autoclass()

bool google::cloud::storage::BucketMetadata::has_autoclass ( ) const
inline

Definition at line 75 of file bucket_metadata.h.

◆ has_billing()

bool google::cloud::storage::BucketMetadata::has_billing ( ) const
inline

Definition at line 96 of file bucket_metadata.h.

◆ has_custom_placement_config()

bool google::cloud::storage::BucketMetadata::has_custom_placement_config ( ) const
inline

Placement configuration can only be set when the bucket is created.

Definition at line 539 of file bucket_metadata.h.

◆ has_encryption()

bool google::cloud::storage::BucketMetadata::has_encryption ( ) const
inline

Definition at line 191 of file bucket_metadata.h.

◆ has_iam_configuration()

bool google::cloud::storage::BucketMetadata::has_iam_configuration ( ) const
inline

Definition at line 227 of file bucket_metadata.h.

◆ has_label()

bool google::cloud::storage::BucketMetadata::has_label ( std::string const &  key) const
inline

Returns true if the key is present in the Bucket's metadata labels.

Definition at line 266 of file bucket_metadata.h.

◆ has_lifecycle()

bool google::cloud::storage::BucketMetadata::has_lifecycle ( ) const
inline

Definition at line 314 of file bucket_metadata.h.

◆ has_logging()

bool google::cloud::storage::BucketMetadata::has_logging ( ) const
inline

Definition at line 349 of file bucket_metadata.h.

◆ has_owner()

bool google::cloud::storage::BucketMetadata::has_owner ( ) const
inline

Returns true if the bucket owner attribute is present.

Definition at line 389 of file bucket_metadata.h.

◆ has_retention_policy()

bool google::cloud::storage::BucketMetadata::has_retention_policy ( ) const
inline

Sets the retention period.

The retention period is the only writable attribute in a retention policy. This function makes it easier to set the retention policy when the BucketMetadata object is used to update or patch the bucket.

Definition at line 427 of file bucket_metadata.h.

◆ has_versioning()

bool google::cloud::storage::BucketMetadata::has_versioning ( ) const
inline

Definition at line 501 of file bucket_metadata.h.

◆ has_website()

bool google::cloud::storage::BucketMetadata::has_website ( ) const
inline

Definition at line 522 of file bucket_metadata.h.

◆ iam_configuration()

BucketIamConfiguration const& google::cloud::storage::BucketMetadata::iam_configuration ( ) const
inline

Definition at line 228 of file bucket_metadata.h.

◆ iam_configuration_as_optional()

absl::optional<BucketIamConfiguration> const& google::cloud::storage::BucketMetadata::iam_configuration_as_optional ( ) const
inline

Definition at line 231 of file bucket_metadata.h.

◆ id()

std::string const& google::cloud::storage::BucketMetadata::id ( ) const
inline

Return the bucket id.

Definition at line 246 of file bucket_metadata.h.

◆ kind()

std::string const& google::cloud::storage::BucketMetadata::kind ( ) const
inline

Definition at line 254 of file bucket_metadata.h.

◆ label()

std::string const& google::cloud::storage::BucketMetadata::label ( std::string const &  key) const
inline

Returns the value of key in the Bucket's metadata labels.

It is undefined behavior to call label(key) if has_label(key) == false.

Definition at line 275 of file bucket_metadata.h.

◆ labels()

std::map<std::string, std::string> const& google::cloud::storage::BucketMetadata::labels ( ) const
inline

Returns all the Bucket's labels.

Definition at line 301 of file bucket_metadata.h.

◆ lifecycle()

BucketLifecycle const& google::cloud::storage::BucketMetadata::lifecycle ( ) const
inline

Definition at line 315 of file bucket_metadata.h.

◆ lifecycle_as_optional()

absl::optional<BucketLifecycle> const& google::cloud::storage::BucketMetadata::lifecycle_as_optional ( ) const
inline

Definition at line 316 of file bucket_metadata.h.

◆ location()

std::string const& google::cloud::storage::BucketMetadata::location ( ) const
inline

Return the bucket location.

Definition at line 330 of file bucket_metadata.h.

◆ location_type()

std::string const& google::cloud::storage::BucketMetadata::location_type ( ) const
inline

Returns the location type (e.g. regional vs. dual region).

Definition at line 339 of file bucket_metadata.h.

◆ logging()

BucketLogging const& google::cloud::storage::BucketMetadata::logging ( ) const
inline

Definition at line 350 of file bucket_metadata.h.

◆ logging_as_optional()

absl::optional<BucketLogging> const& google::cloud::storage::BucketMetadata::logging_as_optional ( ) const
inline

Definition at line 351 of file bucket_metadata.h.

◆ metageneration()

std::int64_t google::cloud::storage::BucketMetadata::metageneration ( ) const
inline

The bucket metageneration.

Definition at line 365 of file bucket_metadata.h.

◆ mutable_acl()

std::vector<BucketAccessControl>& google::cloud::storage::BucketMetadata::mutable_acl ( )
inline

Definition at line 66 of file bucket_metadata.h.

◆ mutable_cors()

std::vector<CorsEntry>& google::cloud::storage::BucketMetadata::mutable_cors ( )
inline

Definition at line 150 of file bucket_metadata.h.

◆ mutable_default_acl()

std::vector<ObjectAccessControl>& google::cloud::storage::BucketMetadata::mutable_default_acl ( )
inline

Definition at line 171 of file bucket_metadata.h.

◆ mutable_labels()

std::map<std::string, std::string>& google::cloud::storage::BucketMetadata::mutable_labels ( )
inline

Returns all the Bucket's labels.

Definition at line 304 of file bucket_metadata.h.

◆ name()

std::string const& google::cloud::storage::BucketMetadata::name ( ) const
inline

The bucket name.

Definition at line 374 of file bucket_metadata.h.

◆ owner()

Owner const& google::cloud::storage::BucketMetadata::owner ( ) const
inline

Returns the owner.

It is undefined behavior to call owner() if has_owner() is false.

Definition at line 395 of file bucket_metadata.h.

◆ project_number()

std::int64_t const& google::cloud::storage::BucketMetadata::project_number ( ) const
inline

Definition at line 408 of file bucket_metadata.h.

◆ reset_autoclass()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_autoclass ( )
inline

Definition at line 84 of file bucket_metadata.h.

◆ reset_billing()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_billing ( )
inline

Definition at line 105 of file bucket_metadata.h.

◆ reset_custom_placement_config()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_custom_placement_config ( )
inline

Placement configuration can only be set when the bucket is created.

Definition at line 555 of file bucket_metadata.h.

◆ reset_encryption()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_encryption ( )
inline

Definition at line 200 of file bucket_metadata.h.

◆ reset_iam_configuration()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_iam_configuration ( )
inline

Definition at line 239 of file bucket_metadata.h.

◆ reset_lifecycle()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_lifecycle ( )
inline

Definition at line 323 of file bucket_metadata.h.

◆ reset_logging()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_logging ( )
inline

Definition at line 358 of file bucket_metadata.h.

◆ reset_owner()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_owner ( )
inline
Note
this is only intended for mocking.

Definition at line 403 of file bucket_metadata.h.

◆ reset_retention_policy()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_retention_policy ( )
inline

Sets the retention period.

The retention period is the only writable attribute in a retention policy. This function makes it easier to set the retention policy when the BucketMetadata object is used to update or patch the bucket.

Definition at line 452 of file bucket_metadata.h.

◆ reset_versioning()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_versioning ( )
inline

Definition at line 510 of file bucket_metadata.h.

◆ reset_website()

BucketMetadata& google::cloud::storage::BucketMetadata::reset_website ( )
inline

Definition at line 531 of file bucket_metadata.h.

◆ retention_policy()

BucketRetentionPolicy const& google::cloud::storage::BucketMetadata::retention_policy ( ) const
inline

Sets the retention period.

The retention period is the only writable attribute in a retention policy. This function makes it easier to set the retention policy when the BucketMetadata object is used to update or patch the bucket.

Definition at line 428 of file bucket_metadata.h.

◆ retention_policy_as_optional()

absl::optional<BucketRetentionPolicy> const& google::cloud::storage::BucketMetadata::retention_policy_as_optional ( ) const
inline

Sets the retention period.

The retention period is the only writable attribute in a retention policy. This function makes it easier to set the retention policy when the BucketMetadata object is used to update or patch the bucket.

Definition at line 431 of file bucket_metadata.h.

◆ rpo()

std::string const& google::cloud::storage::BucketMetadata::rpo ( ) const
inline

Definition at line 460 of file bucket_metadata.h.

◆ self_link()

std::string const& google::cloud::storage::BucketMetadata::self_link ( ) const
inline

Returns a HTTP link to retrieve the bucket metadata.

Definition at line 417 of file bucket_metadata.h.

◆ set_acl()

BucketMetadata& google::cloud::storage::BucketMetadata::set_acl ( std::vector< BucketAccessControl acl)
inline

Definition at line 67 of file bucket_metadata.h.

◆ set_autoclass()

BucketMetadata& google::cloud::storage::BucketMetadata::set_autoclass ( BucketAutoclass  v)
inline

Definition at line 80 of file bucket_metadata.h.

◆ set_billing()

BucketMetadata& google::cloud::storage::BucketMetadata::set_billing ( BucketBilling const &  v)
inline

Definition at line 101 of file bucket_metadata.h.

◆ set_cors()

BucketMetadata& google::cloud::storage::BucketMetadata::set_cors ( std::vector< CorsEntry cors)
inline

Definition at line 151 of file bucket_metadata.h.

◆ set_custom_placement_config()

BucketMetadata& google::cloud::storage::BucketMetadata::set_custom_placement_config ( BucketCustomPlacementConfig  v)
inline

Placement configuration can only be set when the bucket is created.

Definition at line 550 of file bucket_metadata.h.

◆ set_default_acl()

BucketMetadata& google::cloud::storage::BucketMetadata::set_default_acl ( std::vector< ObjectAccessControl acl)
inline

Definition at line 174 of file bucket_metadata.h.

◆ set_default_event_based_hold()

BucketMetadata& google::cloud::storage::BucketMetadata::set_default_event_based_hold ( bool  v)
inline

Definition at line 130 of file bucket_metadata.h.

◆ set_encryption()

BucketMetadata& google::cloud::storage::BucketMetadata::set_encryption ( BucketEncryption  v)
inline

Definition at line 196 of file bucket_metadata.h.

◆ set_etag()

BucketMetadata& google::cloud::storage::BucketMetadata::set_etag ( std::string  v)
inline
Note
This is only intended for mocking.

Definition at line 209 of file bucket_metadata.h.

◆ set_iam_configuration()

BucketMetadata& google::cloud::storage::BucketMetadata::set_iam_configuration ( BucketIamConfiguration  v)
inline

Definition at line 235 of file bucket_metadata.h.

◆ set_id()

BucketMetadata& google::cloud::storage::BucketMetadata::set_id ( std::string  v)
inline
Note
This is only intended for mocking.

Definition at line 249 of file bucket_metadata.h.

◆ set_kind()

BucketMetadata& google::cloud::storage::BucketMetadata::set_kind ( std::string  v)
inline
Note
This is only intended for mocking

Definition at line 257 of file bucket_metadata.h.

◆ set_lifecycle()

BucketMetadata& google::cloud::storage::BucketMetadata::set_lifecycle ( BucketLifecycle  v)
inline

Definition at line 319 of file bucket_metadata.h.

◆ set_location()

BucketMetadata& google::cloud::storage::BucketMetadata::set_location ( std::string  v)
inline

Set the bucket location. Only applicable when creating buckets.

Definition at line 333 of file bucket_metadata.h.

◆ set_location_type()

BucketMetadata& google::cloud::storage::BucketMetadata::set_location_type ( std::string  v)
inline
Note
This is only intended for mocking.

Definition at line 342 of file bucket_metadata.h.

◆ set_logging()

BucketMetadata& google::cloud::storage::BucketMetadata::set_logging ( BucketLogging  v)
inline

Definition at line 354 of file bucket_metadata.h.

◆ set_metageneration()

BucketMetadata& google::cloud::storage::BucketMetadata::set_metageneration ( std::int64_t  v)
inline
Note
this is only intended for mocking.

Definition at line 368 of file bucket_metadata.h.

◆ set_name()

BucketMetadata& google::cloud::storage::BucketMetadata::set_name ( std::string  v)
inline

Changes the name.

Note
Bucket names can only be set during bucket creation. This modifier is used to set the name when using a BucketMetadata object that changes some other attribute.

Definition at line 383 of file bucket_metadata.h.

◆ set_owner()

BucketMetadata& google::cloud::storage::BucketMetadata::set_owner ( Owner  v)
inline
Note
this is only intended for mocking.

Definition at line 398 of file bucket_metadata.h.

◆ set_project_number()

BucketMetadata& google::cloud::storage::BucketMetadata::set_project_number ( std::int64_t  v)
inline
Note
this is only intended for mocking.

Definition at line 411 of file bucket_metadata.h.

◆ set_retention_policy() [1/2]

BucketMetadata& google::cloud::storage::BucketMetadata::set_retention_policy ( BucketRetentionPolicy  v)
inline

Sets the retention period.

The retention period is the only writable attribute in a retention policy. This function makes it easier to set the retention policy when the BucketMetadata object is used to update or patch the bucket.

Definition at line 435 of file bucket_metadata.h.

◆ set_retention_policy() [2/2]

BucketMetadata& google::cloud::storage::BucketMetadata::set_retention_policy ( std::chrono::seconds  retention_period)
inline

Sets the retention period.

The retention period is the only writable attribute in a retention policy. This function makes it easier to set the retention policy when the BucketMetadata object is used to update or patch the bucket.

Definition at line 447 of file bucket_metadata.h.

◆ set_rpo()

BucketMetadata& google::cloud::storage::BucketMetadata::set_rpo ( std::string  v)
inline

Definition at line 461 of file bucket_metadata.h.

◆ set_self_link()

BucketMetadata& google::cloud::storage::BucketMetadata::set_self_link ( std::string  v)
inline
Note
this is only intended for mocking.

Definition at line 420 of file bucket_metadata.h.

◆ set_storage_class()

BucketMetadata& google::cloud::storage::BucketMetadata::set_storage_class ( std::string  v)
inline

Definition at line 470 of file bucket_metadata.h.

◆ set_time_created()

BucketMetadata& google::cloud::storage::BucketMetadata::set_time_created ( std::chrono::system_clock::time_point  v)
inline
Note
This is only intended for mocking.

Definition at line 482 of file bucket_metadata.h.

◆ set_updated()

BucketMetadata& google::cloud::storage::BucketMetadata::set_updated ( std::chrono::system_clock::time_point  v)
inline
Note
This is only intended for mocking.

Definition at line 491 of file bucket_metadata.h.

◆ set_versioning()

BucketMetadata& google::cloud::storage::BucketMetadata::set_versioning ( absl::optional< BucketVersioning v)
inline

Definition at line 514 of file bucket_metadata.h.

◆ set_website()

BucketMetadata& google::cloud::storage::BucketMetadata::set_website ( BucketWebsite  v)
inline

Definition at line 527 of file bucket_metadata.h.

◆ storage_class()

std::string const& google::cloud::storage::BucketMetadata::storage_class ( ) const
inline

Definition at line 469 of file bucket_metadata.h.

◆ time_created()

std::chrono::system_clock::time_point google::cloud::storage::BucketMetadata::time_created ( ) const
inline

Returns the bucket creation timestamp.

Definition at line 477 of file bucket_metadata.h.

◆ updated()

std::chrono::system_clock::time_point google::cloud::storage::BucketMetadata::updated ( ) const
inline

Returns the timestamp for the last bucket metadata update.

Definition at line 488 of file bucket_metadata.h.

◆ upsert_label()

BucketMetadata& google::cloud::storage::BucketMetadata::upsert_label ( std::string  key,
std::string  value 
)
inline

Insert or update the label entry.

Definition at line 290 of file bucket_metadata.h.

◆ versioning()

absl::optional<BucketVersioning> const& google::cloud::storage::BucketMetadata::versioning ( ) const
inline

Definition at line 498 of file bucket_metadata.h.

◆ website()

BucketWebsite const& google::cloud::storage::BucketMetadata::website ( ) const
inline

Definition at line 523 of file bucket_metadata.h.

◆ website_as_optional()

absl::optional<BucketWebsite> const& google::cloud::storage::BucketMetadata::website_as_optional ( ) const
inline

Definition at line 524 of file bucket_metadata.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( BucketMetadata const &  lhs,
BucketMetadata const &  rhs 
)
friend

Definition at line 562 of file bucket_metadata.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
BucketMetadata const &  rhs 
)
friend

◆ operator==

bool operator== ( BucketMetadata const &  lhs,
BucketMetadata const &  rhs 
)
friend