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

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

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

Public Member Functions

 BucketMetadata ()=default
 
Get and set Bucket Access Control Lists.
std::vector< BucketAccessControl > const & acl () const
 
std::vector< BucketAccessControl > & mutable_acl ()
 
BucketMetadataset_acl (std::vector< BucketAccessControl > acl)
 
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
 Delete a label. This is a no-op if the key does not exist. More...
 
std::string const & label (std::string const &key) const
 Delete a label. This is a no-op if the key does not exist. 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
 Delete a label. This is a no-op if the key does not exist. More...
 
std::map< std::string, std::string > & mutable_labels ()
 Delete a label. This is a no-op if the key does not exist. 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 ()
 
std::string const & location () const
 
BucketMetadataset_location (std::string v)
 
std::string const & location_type () const
 
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 ()
 
BucketMetadataset_name (std::string v)
 
std::int64_t const & project_number () const
 
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...
 
BucketMetadataset_storage_class (std::string v)
 Sets the retention period. More...
 
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 ()
 
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 522 of file bucket_metadata.h.

Constructor & Destructor Documentation

◆ BucketMetadata()

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

Member Function Documentation

◆ acl()

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

Definition at line 534 of file bucket_metadata.h.

◆ billing()

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

Definition at line 549 of file bucket_metadata.h.

◆ billing_as_optional()

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

Definition at line 550 of file bucket_metadata.h.

◆ cors()

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

Definition at line 601 of file bucket_metadata.h.

◆ default_acl()

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

Definition at line 620 of file bucket_metadata.h.

◆ default_event_based_hold()

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

Definition at line 581 of file bucket_metadata.h.

◆ delete_label()

BucketMetadata& google::cloud::storage::v1::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 703 of file bucket_metadata.h.

◆ disable_versioning()

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

Definition at line 840 of file bucket_metadata.h.

◆ enable_versioning()

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

Definition at line 836 of file bucket_metadata.h.

◆ encryption()

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

Definition at line 644 of file bucket_metadata.h.

◆ encryption_as_optional()

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

Definition at line 645 of file bucket_metadata.h.

◆ has_billing()

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

Definition at line 548 of file bucket_metadata.h.

◆ has_encryption()

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

Definition at line 643 of file bucket_metadata.h.

◆ has_iam_configuration()

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

Definition at line 673 of file bucket_metadata.h.

◆ has_label()

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

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

Definition at line 696 of file bucket_metadata.h.

◆ has_lifecycle()

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

Definition at line 734 of file bucket_metadata.h.

◆ has_logging()

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

Definition at line 759 of file bucket_metadata.h.

◆ has_retention_policy()

bool google::cloud::storage::v1::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 790 of file bucket_metadata.h.

◆ has_versioning()

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

Definition at line 835 of file bucket_metadata.h.

◆ has_website()

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

Definition at line 856 of file bucket_metadata.h.

◆ iam_configuration()

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

Definition at line 674 of file bucket_metadata.h.

◆ iam_configuration_as_optional()

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

Definition at line 677 of file bucket_metadata.h.

◆ label()

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

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

Definition at line 699 of file bucket_metadata.h.

◆ labels()

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

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

Definition at line 723 of file bucket_metadata.h.

◆ lifecycle()

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

Definition at line 735 of file bucket_metadata.h.

◆ lifecycle_as_optional()

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

Definition at line 736 of file bucket_metadata.h.

◆ location()

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

Definition at line 749 of file bucket_metadata.h.

◆ location_type()

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

Definition at line 755 of file bucket_metadata.h.

◆ logging()

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

Definition at line 760 of file bucket_metadata.h.

◆ logging_as_optional()

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

Definition at line 761 of file bucket_metadata.h.

◆ mutable_acl()

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

Definition at line 535 of file bucket_metadata.h.

◆ mutable_cors()

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

Definition at line 602 of file bucket_metadata.h.

◆ mutable_default_acl()

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

Definition at line 623 of file bucket_metadata.h.

◆ mutable_labels()

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

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

Definition at line 724 of file bucket_metadata.h.

◆ project_number()

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

Definition at line 784 of file bucket_metadata.h.

◆ reset_billing()

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

Definition at line 557 of file bucket_metadata.h.

◆ reset_encryption()

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

Definition at line 652 of file bucket_metadata.h.

◆ reset_iam_configuration()

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

Definition at line 685 of file bucket_metadata.h.

◆ reset_lifecycle()

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

Definition at line 743 of file bucket_metadata.h.

◆ reset_logging()

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

Definition at line 768 of file bucket_metadata.h.

◆ reset_retention_policy()

BucketMetadata& google::cloud::storage::v1::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 815 of file bucket_metadata.h.

◆ reset_versioning()

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

Definition at line 844 of file bucket_metadata.h.

◆ reset_website()

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

Definition at line 865 of file bucket_metadata.h.

◆ retention_policy()

BucketRetentionPolicy const& google::cloud::storage::v1::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 791 of file bucket_metadata.h.

◆ retention_policy_as_optional()

absl::optional<BucketRetentionPolicy> const& google::cloud::storage::v1::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 794 of file bucket_metadata.h.

◆ set_acl()

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

Definition at line 536 of file bucket_metadata.h.

◆ set_billing()

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

Definition at line 553 of file bucket_metadata.h.

◆ set_cors()

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

Definition at line 603 of file bucket_metadata.h.

◆ set_default_acl()

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

Definition at line 626 of file bucket_metadata.h.

◆ set_default_event_based_hold()

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

Definition at line 582 of file bucket_metadata.h.

◆ set_encryption()

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

Definition at line 648 of file bucket_metadata.h.

◆ set_iam_configuration()

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

Definition at line 681 of file bucket_metadata.h.

◆ set_lifecycle()

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

Definition at line 739 of file bucket_metadata.h.

◆ set_location()

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

Definition at line 750 of file bucket_metadata.h.

◆ set_logging()

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

Definition at line 764 of file bucket_metadata.h.

◆ set_name()

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

Definition at line 776 of file bucket_metadata.h.

◆ set_retention_policy() [1/2]

BucketMetadata& google::cloud::storage::v1::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 798 of file bucket_metadata.h.

◆ set_retention_policy() [2/2]

BucketMetadata& google::cloud::storage::v1::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 810 of file bucket_metadata.h.

◆ set_storage_class()

BucketMetadata& google::cloud::storage::v1::BucketMetadata::set_storage_class ( std::string  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 822 of file bucket_metadata.h.

◆ set_versioning()

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

Definition at line 848 of file bucket_metadata.h.

◆ set_website()

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

Definition at line 861 of file bucket_metadata.h.

◆ upsert_label()

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

Insert or update the label entry.

Definition at line 713 of file bucket_metadata.h.

◆ versioning()

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

Definition at line 832 of file bucket_metadata.h.

◆ website()

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

Definition at line 857 of file bucket_metadata.h.

◆ website_as_optional()

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

Definition at line 858 of file bucket_metadata.h.

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 872 of file bucket_metadata.h.

◆ operator<<

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

Definition at line 107 of file bucket_metadata.cc.

◆ operator==

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

Definition at line 90 of file bucket_metadata.cc.