3.8.0-rc 3.7.0 (latest) 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0 Represents a Google Cloud Storage Bucket Metadata object.

## Constructors

### BucketMetadata()

## Functions

### acl() const

Get and set Bucket Access Control Lists.

###### See Also

<https://cloud.google.com/storage/docs/access-control/lists>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::vector< BucketAccessControl > const &` |   |

### mutable_acl()

Get and set Bucket Access Control Lists.

###### See Also

<https://cloud.google.com/storage/docs/access-control/lists>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::vector< BucketAccessControl > &` |   |

### set_acl(std::vector\< BucketAccessControl \>)

Get and set Bucket Access Control Lists.

###### See Also

<https://cloud.google.com/storage/docs/access-control/lists>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `acl` | `std::vector< BucketAccessControl >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_autoclass() const

Accessors and modifiers for Autoclass configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### autoclass() const

Accessors and modifiers for Autoclass configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketAutoclass const &` |   |

### autoclass_as_optional() const

Accessors and modifiers for Autoclass configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketAutoclass > const &` |   |

### set_autoclass(BucketAutoclass)

Accessors and modifiers for Autoclass configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketAutoclass` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_autoclass()

Accessors and modifiers for Autoclass configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_billing() const

Get and set billing configuration for the Bucket.

###### See Also

<https://cloud.google.com/storage/docs/requester-pays>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### billing() const

Get and set billing configuration for the Bucket.

###### See Also

<https://cloud.google.com/storage/docs/requester-pays>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketBilling const &` |   |

### billing_as_optional() const

Get and set billing configuration for the Bucket.

###### See Also

<https://cloud.google.com/storage/docs/requester-pays>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketBilling > const &` |   |

### set_billing(BucketBilling const \&)

Get and set billing configuration for the Bucket.

###### See Also

<https://cloud.google.com/storage/docs/requester-pays>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketBilling const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_billing()

Get and set billing configuration for the Bucket.

###### See Also

<https://cloud.google.com/storage/docs/requester-pays>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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()`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1a6c820acb0feed307ec1316f845634bfa) 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](https://cloud.google.com/storage/docs/bucket-lock#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** ||
|---|---|
| **Type** | **Description** |
| `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()`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1a6c820acb0feed307ec1316f845634bfa) 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](https://cloud.google.com/storage/docs/bucket-lock#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** ||
|---|---|
| **Name** | **Description** |
| `v` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Name** | **Description** |
| `cors` | `std::vector< CorsEntry >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Name** | **Description** |
| `acl` | `std::vector< ObjectAccessControl >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `std::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** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketEncryption` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_hierarchical_namespace() const

Get and set the hierarchical namespaces configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hierarchical_namespace() const

Get and set the hierarchical namespaces configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketHierarchicalNamespace const &` |   |

### hierarchical_namespace_as_optional() const

Get and set the hierarchical namespaces configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketHierarchicalNamespace > const &` |   |

### set_hierarchical_namespace(BucketHierarchicalNamespace)

Get and set the hierarchical namespaces configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketHierarchicalNamespace` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_hierarchical_namespace()

Get and set the hierarchical namespaces configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_iam_configuration() const

Get and set the IAM configuration.

###### See Also

Before enabling Uniform Bucket Level Access please review the [feature documentation](https://cloud.google.com/storage/docs/uniform-bucket-level-access), as well as ["Should you use uniform bucket-level access ?"](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### iam_configuration() const

Get and set the IAM configuration.

###### See Also

Before enabling Uniform Bucket Level Access please review the [feature documentation](https://cloud.google.com/storage/docs/uniform-bucket-level-access), as well as ["Should you use uniform bucket-level access ?"](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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](https://cloud.google.com/storage/docs/uniform-bucket-level-access), as well as ["Should you use uniform bucket-level access ?"](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::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](https://cloud.google.com/storage/docs/uniform-bucket-level-access), as well as ["Should you use uniform bucket-level access ?"](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketIamConfiguration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_iam_configuration()

Get and set the IAM configuration.

###### See Also

Before enabling Uniform Bucket Level Access please review the [feature documentation](https://cloud.google.com/storage/docs/uniform-bucket-level-access), as well as ["Should you use uniform bucket-level access ?"](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_label(std::string const \&) const

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `std::string const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Name** | **Description** |
| `key` | `std::string const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### delete_label(std::string const \&)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `std::string const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

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

Insert or update the label entry.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `std::string` |
| `value` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### labels() const

Returns all the Bucket's labels.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::map< std::string, std::string > const &` |   |

### mutable_labels()

Returns all the Bucket's labels.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1af201c57043f38a873d45e29b19ae3773) rules.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1af201c57043f38a873d45e29b19ae3773) rules.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1af201c57043f38a873d45e29b19ae3773) rules.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::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](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1af201c57043f38a873d45e29b19ae3773) rules.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketLifecycle` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1af201c57043f38a873d45e29b19ae3773) rules.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_logging() const

Accessors and modifiers for logging configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### logging() const

Accessors and modifiers for logging configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketLogging const &` |   |

### logging_as_optional() const

Accessors and modifiers for logging configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketLogging > const &` |   |

### set_logging(BucketLogging)

Accessors and modifiers for logging configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketLogging` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_logging()

Accessors and modifiers for logging configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketRetentionPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `retention_period` | `std::chrono::seconds` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### rpo() const

Accessors and modifiers for the Recovery Point Objective.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_rpo(std::string)

Accessors and modifiers for the Recovery Point Objective.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_soft_delete_policy() const

Sets the soft delete policy.
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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### soft_delete_policy() const

Sets the soft delete policy.
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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketSoftDeletePolicy const &` |   |

### soft_delete_policy_as_optional() const

Sets the soft delete policy.
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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketSoftDeletePolicy > const &` |   |

### set_soft_delete_policy(BucketSoftDeletePolicy)

Sets the soft delete policy.
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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketSoftDeletePolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### set_soft_delete_policy(std::chrono::seconds)

Sets the soft delete policy.
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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `retention_duration` | `std::chrono::seconds` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_soft_delete_policy()

Sets the soft delete policy.
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`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object is used to update or patch the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### storage_class() const

Access and modify the default storage class attribute.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_storage_class(std::string)

Access and modify the default storage class attribute.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### versioning() const

Accessors and modifiers for versioning configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketVersioning > const &` |   |

### has_versioning() const

Accessors and modifiers for versioning configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### enable_versioning()

Accessors and modifiers for versioning configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### disable_versioning()

Accessors and modifiers for versioning configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_versioning()

Accessors and modifiers for versioning configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### set_versioning(std::optional\< BucketVersioning \>)

Accessors and modifiers for versioning configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::optional< BucketVersioning >` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_website() const

Accessors and modifiers for website configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### website() const

Accessors and modifiers for website configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketWebsite const &` |   |

### website_as_optional() const

Accessors and modifiers for website configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketWebsite > const &` |   |

### set_website(BucketWebsite)

Accessors and modifiers for website configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketWebsite` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_website()

Accessors and modifiers for website configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_custom_placement_config() const

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### custom_placement_config() const

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketCustomPlacementConfig const &` |   |

### custom_placement_config_as_optional() const

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::optional< BucketCustomPlacementConfig > const &` |   |

### set_custom_placement_config(BucketCustomPlacementConfig)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketCustomPlacementConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_custom_placement_config()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### etag() const

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_etag(std::string)

> [!NOTE]
> **Note:** This is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### id() const

Return the bucket id.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_id(std::string)

> [!NOTE]
> **Note:** This is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### kind() const

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_kind(std::string)

> [!NOTE]
> **Note:** This is only intended for mocking

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### location() const

Return the bucket location.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_location(std::string)

Set the bucket location. Only applicable when creating buckets.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### location_type() const

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_location_type(std::string)

> [!NOTE]
> **Note:** This is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### metageneration() const

The bucket metageneration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::int64_t` |   |

### set_metageneration(std::int64_t)

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::int64_t` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### name() const

The bucket name.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_name(std::string)

Changes the name.

> [!NOTE]
> **Note:** Bucket names can only be set during bucket creation. This modifier is used to set the name when using a [`BucketMetadata`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata) object that changes some other attribute.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_object_retention() const

Returns true if the bucket `object_retention` attribute is present.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### object_retention() const

Returns the owner.
It is undefined behavior to call [`owner()`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1a9c5be9a7aa3c4ed2827bd17ff0432030) if [`has_owner()`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1ad3eafd7a5610d7bc3a6564f566baf1e0) is false.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketObjectRetention const &` |   |

### set_object_retention(BucketObjectRetention)

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `BucketObjectRetention` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_object_retention()

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### has_owner() const

Returns true if the bucket `owner` attribute is present.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### owner() const

Returns the owner.
It is undefined behavior to call [`owner()`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1a9c5be9a7aa3c4ed2827bd17ff0432030) if [`has_owner()`](https://docs.cloud.google.com/cpp/docs/reference/storage/latest/classgoogle_1_1cloud_1_1storage_1_1BucketMetadata#classgoogle_1_1cloud_1_1storage_1_1BucketMetadata_1ad3eafd7a5610d7bc3a6564f566baf1e0) is false.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Owner const &` |   |

### set_owner(Owner)

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `Owner` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### reset_owner()

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### project_number() const

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::int64_t const &` |   |

### set_project_number(std::int64_t)

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::int64_t` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### self_link() const

Returns a HTTP link to retrieve the bucket metadata.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::string const &` |   |

### set_self_link(std::string)

> [!NOTE]
> **Note:** this is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### time_created() const

Returns the bucket creation timestamp.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::chrono::system_clock::time_point` |   |

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

> [!NOTE]
> **Note:** This is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::chrono::system_clock::time_point` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |

### updated() const

Returns the timestamp for the last bucket metadata update.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `std::chrono::system_clock::time_point` |   |

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

> [!NOTE]
> **Note:** This is only intended for mocking.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `v` | `std::chrono::system_clock::time_point` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `BucketMetadata &` |   |