# Google Cloud Database Center V1beta Client - Class RetentionSettingsInfo (0.7.0)

0.7.0 (latest) 0.6.0 0.5.0 0.4.1 0.3.1 0.2.0 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Database Center V1beta Client class RetentionSettingsInfo.

Metadata about backup retention settings for a database resource.

Generated from protobuf message `google.cloud.databasecenter.v1beta.RetentionSettingsInfo`

## Namespace

Google \\ Cloud \\ DatabaseCenter \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ quantity_based_retention` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` Number of backups that will be retained. |
| `↳ duration_based_retention` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Duration based retention period i.e. 172800 seconds (2 days) |
| `↳ timestamp_based_retention_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Timestamp based retention period i.e. till 2024-05-01T00:00:00Z |
| `↳ sub_resource` | `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.SubResource` Optional. Sub resource details associated with the backup configuration. |

### getQuantityBasedRetention

Number of backups that will be retained.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value|null` |   |

### hasQuantityBasedRetention

### getQuantityBasedRetentionUnwrapped

Returns the unboxed value from `getQuantityBasedRetention()`

Number of backups that will be retained.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|null` |   |

### setQuantityBasedRetention

Number of backups that will be retained.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setQuantityBasedRetentionUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int32Value object.

Number of backups that will be retained.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDurationBasedRetention

Duration based retention period i.e. 172800 seconds (2 days)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasDurationBasedRetention

### setDurationBasedRetention

Duration based retention period i.e. 172800 seconds (2 days)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTimestampBasedRetentionTime

Timestamp based retention period i.e. till 2024-05-01T00:00:00Z

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasTimestampBasedRetentionTime

### setTimestampBasedRetentionTime

Timestamp based retention period i.e. till 2024-05-01T00:00:00Z

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSubResource

Optional. Sub resource details associated with the backup configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.SubResource|null` |   |

### hasSubResource

### clearSubResource

### setSubResource

Optional. Sub resource details associated with the backup configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.SubResource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRetention

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |