Class BucketMetadata (2.19.0)

Represents a Google Cloud Storage Bucket Metadata object.

Constructors

BucketMetadata()

Functions

acl() const

Get and set Bucket Access Control Lists.

Returns
TypeDescription
std::vector< BucketAccessControl > const &

mutable_acl()

Get and set Bucket Access Control Lists.

Returns
TypeDescription
std::vector< BucketAccessControl > &

set_acl(std::vector< BucketAccessControl >)

Get and set Bucket Access Control Lists.

Parameter
NameDescription
acl std::vector< BucketAccessControl >
Returns
TypeDescription
BucketMetadata &

has_autoclass() const

Accessors and modifiers for Autoclass configuration.

Returns
TypeDescription
bool

autoclass() const

Accessors and modifiers for Autoclass configuration.

Returns
TypeDescription
BucketAutoclass const &

autoclass_as_optional() const

Accessors and modifiers for Autoclass configuration.

Returns
TypeDescription
absl::optional< BucketAutoclass > const &

set_autoclass(BucketAutoclass)

Accessors and modifiers for Autoclass configuration.

Parameter
NameDescription
v BucketAutoclass
Returns
TypeDescription
BucketMetadata &

reset_autoclass()

Accessors and modifiers for Autoclass configuration.

Returns
TypeDescription
BucketMetadata &

has_billing() const

Get and set billing configuration for the Bucket.

Returns
TypeDescription
bool

billing() const

Get and set billing configuration for the Bucket.

Returns
TypeDescription
BucketBilling const &

billing_as_optional() const

Get and set billing configuration for the Bucket.

Returns
TypeDescription
absl::optional< BucketBilling > const &

set_billing(BucketBilling const &)

Get and set billing configuration for the Bucket.

Parameter
NameDescription
v BucketBilling const &
Returns
TypeDescription
BucketMetadata &

reset_billing()

Get and set billing configuration for the Bucket.

Returns
TypeDescription
BucketMetadata &

default_event_based_hold() const

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.

See Also

https://cloud.google.com/storage/docs/holding-objects for examples of using default event-based hold policy.

Returns
TypeDescription
bool

set_default_event_based_hold(bool)

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.

See Also

https://cloud.google.com/storage/docs/holding-objects for examples of using default event-based hold policy.

Parameter
NameDescription
v bool
Returns
TypeDescription
BucketMetadata &

cors() const

Get and set CORS configuration for the Bucket.

See Also

https://en.wikipedia.org/wiki/Cross-origin_resource_sharing for general information on CORS.

See Also

https://cloud.google.com/storage/docs/cross-origin for general information about CORS in the context of Google Cloud Storage.

See Also

https://cloud.google.com/storage/docs/configuring-cors for information on how to set and troubleshoot CORS settings.

Returns
TypeDescription
std::vector< CorsEntry > const &

mutable_cors()

Get and set CORS configuration for the Bucket.

See Also

https://en.wikipedia.org/wiki/Cross-origin_resource_sharing for general information on CORS.

See Also

https://cloud.google.com/storage/docs/cross-origin for general information about CORS in the context of Google Cloud Storage.

See Also

https://cloud.google.com/storage/docs/configuring-cors for information on how to set and troubleshoot CORS settings.

Returns
TypeDescription
std::vector< CorsEntry > &

set_cors(std::vector< CorsEntry >)

Get and set CORS configuration for the Bucket.

See Also

https://en.wikipedia.org/wiki/Cross-origin_resource_sharing for general information on CORS.

See Also

https://cloud.google.com/storage/docs/cross-origin for general information about CORS in the context of Google Cloud Storage.

See Also

https://cloud.google.com/storage/docs/configuring-cors for information on how to set and troubleshoot CORS settings.

Parameter
NameDescription
cors std::vector< CorsEntry >
Returns
TypeDescription
BucketMetadata &

default_acl() const

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Returns
TypeDescription
std::vector< ObjectAccessControl > const &

mutable_default_acl()

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Returns
TypeDescription
std::vector< ObjectAccessControl > &

set_default_acl(std::vector< ObjectAccessControl >)

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Parameter
NameDescription
acl std::vector< ObjectAccessControl >
Returns
TypeDescription
BucketMetadata &

has_encryption() const

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Returns
TypeDescription
bool

encryption() const

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Returns
TypeDescription
BucketEncryption const &

encryption_as_optional() const

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Returns
TypeDescription
absl::optional< BucketEncryption > const &

set_encryption(BucketEncryption)

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Parameter
NameDescription
v BucketEncryption
Returns
TypeDescription
BucketMetadata &

reset_encryption()

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.

See Also

https://cloud.google.com/storage/docs/encryption/customer-managed-keys for information on Customer-Managed Encryption Keys.

Returns
TypeDescription
BucketMetadata &

has_iam_configuration() const

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 ?".

Returns
TypeDescription
bool

iam_configuration() const

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 ?".

Returns
TypeDescription
BucketIamConfiguration const &

iam_configuration_as_optional() const

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 ?".

Returns
TypeDescription
absl::optional< BucketIamConfiguration > const &

set_iam_configuration(BucketIamConfiguration)

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 ?".

Parameter
NameDescription
v BucketIamConfiguration
Returns
TypeDescription
BucketMetadata &

reset_iam_configuration()

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 ?".

Returns
TypeDescription
BucketMetadata &

has_label(std::string const &) const

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

Parameter
NameDescription
key std::string const &
Returns
TypeDescription
bool

label(std::string const &) const

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

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

Parameter
NameDescription
key std::string const &
Returns
TypeDescription
std::string const &

delete_label(std::string const &)

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

Parameter
NameDescription
key std::string const &
Returns
TypeDescription
BucketMetadata &

upsert_label(std::string, std::string)

Insert or update the label entry.

Parameters
NameDescription
key std::string
value std::string
Returns
TypeDescription
BucketMetadata &

labels() const

Returns all the Bucket's labels.

Returns
TypeDescription
std::map< std::string, std::string > const &

mutable_labels()

Returns all the Bucket's labels.

Returns
TypeDescription
std::map< std::string, std::string > &

has_lifecycle() const

Accessors and modifiers for object lifecycle rules.

See Also

https://cloud.google.com/storage/docs/managing-lifecycles for general information on object lifecycle rules.

Returns
TypeDescription
bool

lifecycle() const

Accessors and modifiers for object lifecycle rules.

See Also

https://cloud.google.com/storage/docs/managing-lifecycles for general information on object lifecycle rules.

Returns
TypeDescription
BucketLifecycle const &

lifecycle_as_optional() const

Accessors and modifiers for object lifecycle rules.

See Also

https://cloud.google.com/storage/docs/managing-lifecycles for general information on object lifecycle rules.

Returns
TypeDescription
absl::optional< BucketLifecycle > const &

set_lifecycle(BucketLifecycle)

Accessors and modifiers for object lifecycle rules.

See Also

https://cloud.google.com/storage/docs/managing-lifecycles for general information on object lifecycle rules.

Parameter
NameDescription
v BucketLifecycle
Returns
TypeDescription
BucketMetadata &

reset_lifecycle()

Accessors and modifiers for object lifecycle rules.

See Also

https://cloud.google.com/storage/docs/managing-lifecycles for general information on object lifecycle rules.

Returns
TypeDescription
BucketMetadata &

has_logging() const

Accessors and modifiers for logging configuration.

Returns
TypeDescription
bool

logging() const

Accessors and modifiers for logging configuration.

Returns
TypeDescription
BucketLogging const &

logging_as_optional() const

Accessors and modifiers for logging configuration.

Returns
TypeDescription
absl::optional< BucketLogging > const &

set_logging(BucketLogging)

Accessors and modifiers for logging configuration.

Parameter
NameDescription
v BucketLogging
Returns
TypeDescription
BucketMetadata &

reset_logging()

Accessors and modifiers for logging configuration.

Returns
TypeDescription
BucketMetadata &

has_retention_policy() const

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.

Returns
TypeDescription
bool

retention_policy() const

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.

Returns
TypeDescription
BucketRetentionPolicy const &

retention_policy_as_optional() const

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.

Returns
TypeDescription
absl::optional< BucketRetentionPolicy > const &

set_retention_policy(BucketRetentionPolicy)

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.

Parameter
NameDescription
v BucketRetentionPolicy
Returns
TypeDescription
BucketMetadata &

set_retention_policy(std::chrono::seconds)

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.

Parameter
NameDescription
retention_period std::chrono::seconds
Returns
TypeDescription
BucketMetadata &

reset_retention_policy()

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.

Returns
TypeDescription
BucketMetadata &

rpo() const

Accessors and modifiers for the Recovery Point Objective.

Returns
TypeDescription
std::string const &

set_rpo(std::string)

Accessors and modifiers for the Recovery Point Objective.

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

storage_class() const

Access and modify the default storage class attribute.

Returns
TypeDescription
std::string const &

set_storage_class(std::string)

Access and modify the default storage class attribute.

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

versioning() const

Accessors and modifiers for versioning configuration.

Returns
TypeDescription
absl::optional< BucketVersioning > const &

has_versioning() const

Accessors and modifiers for versioning configuration.

Returns
TypeDescription
bool

enable_versioning()

Accessors and modifiers for versioning configuration.

Returns
TypeDescription
BucketMetadata &

disable_versioning()

Accessors and modifiers for versioning configuration.

Returns
TypeDescription
BucketMetadata &

reset_versioning()

Accessors and modifiers for versioning configuration.

Returns
TypeDescription
BucketMetadata &

set_versioning(absl::optional< BucketVersioning >)

Accessors and modifiers for versioning configuration.

Parameter
NameDescription
v absl::optional< BucketVersioning >
Returns
TypeDescription
BucketMetadata &

has_website() const

Accessors and modifiers for website configuration.

Returns
TypeDescription
bool

website() const

Accessors and modifiers for website configuration.

Returns
TypeDescription
BucketWebsite const &

website_as_optional() const

Accessors and modifiers for website configuration.

Returns
TypeDescription
absl::optional< BucketWebsite > const &

set_website(BucketWebsite)

Accessors and modifiers for website configuration.

Parameter
NameDescription
v BucketWebsite
Returns
TypeDescription
BucketMetadata &

reset_website()

Accessors and modifiers for website configuration.

Returns
TypeDescription
BucketMetadata &

has_custom_placement_config() const

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

Returns
TypeDescription
bool

custom_placement_config() const

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

Returns
TypeDescription
BucketCustomPlacementConfig const &

custom_placement_config_as_optional() const

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

Returns
TypeDescription
absl::optional< BucketCustomPlacementConfig > const &

set_custom_placement_config(BucketCustomPlacementConfig)

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

Parameter
NameDescription
v BucketCustomPlacementConfig
Returns
TypeDescription
BucketMetadata &

reset_custom_placement_config()

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

Returns
TypeDescription
BucketMetadata &

etag() const

Returns
TypeDescription
std::string const &

set_etag(std::string)

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

id() const

Return the bucket id.

Returns
TypeDescription
std::string const &

set_id(std::string)

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

kind() const

Returns
TypeDescription
std::string const &

set_kind(std::string)

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

location() const

Return the bucket location.

Returns
TypeDescription
std::string const &

set_location(std::string)

Set the bucket location. Only applicable when creating buckets.

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

location_type() const

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

Returns
TypeDescription
std::string const &

set_location_type(std::string)

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

metageneration() const

The bucket metageneration.

Returns
TypeDescription
std::int64_t

set_metageneration(std::int64_t)

Parameter
NameDescription
v std::int64_t
Returns
TypeDescription
BucketMetadata &

name() const

The bucket name.

Returns
TypeDescription
std::string const &

set_name(std::string)

Changes the name.

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

has_owner() const

Returns true if the bucket owner attribute is present.

Returns
TypeDescription
bool

owner() const

Returns the owner.

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

Returns
TypeDescription
Owner const &

set_owner(Owner)

Parameter
NameDescription
v Owner
Returns
TypeDescription
BucketMetadata &

reset_owner()

Returns
TypeDescription
BucketMetadata &

project_number() const

Returns
TypeDescription
std::int64_t const &

set_project_number(std::int64_t)

Parameter
NameDescription
v std::int64_t
Returns
TypeDescription
BucketMetadata &

self_link() const

Returns a HTTP link to retrieve the bucket metadata.

Returns
TypeDescription
std::string const &

set_self_link(std::string)

Parameter
NameDescription
v std::string
Returns
TypeDescription
BucketMetadata &

time_created() const

Returns the bucket creation timestamp.

Returns
TypeDescription
std::chrono::system_clock::time_point

set_time_created(std::chrono::system_clock::time_point)

Parameter
NameDescription
v std::chrono::system_clock::time_point
Returns
TypeDescription
BucketMetadata &

updated() const

Returns the timestamp for the last bucket metadata update.

Returns
TypeDescription
std::chrono::system_clock::time_point

set_updated(std::chrono::system_clock::time_point)

Parameter
NameDescription
v std::chrono::system_clock::time_point
Returns
TypeDescription
BucketMetadata &