# Secret Manager V1beta2 Client - Class Rotation (2.3.0)

2.3.0 (latest) 2.2.2 2.1.1 2.0.2 1.15.4 1.13.0 1.12.3 1.11.0 1.10.4 1.9.7

> [!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 Secret Manager V1beta2 Client class Rotation.

The rotation time and period for a
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret). At next_rotation_time,
Secret Manager will send a Pub/Sub notification to the topics configured on
the Secret. [Secret.topics](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret#_Google_Cloud_SecretManager_V1beta2_Secret__getTopics__)
must be set to configure rotation.

Generated from protobuf message `google.cloud.secretmanager.v1beta2.Rotation`

## Namespace

Google \\ Cloud \\ SecretManager \\ V1beta2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ next_rotation_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Optional. Timestamp in UTC at which the [Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is scheduled to rotate. Cannot be set to less than 300s (5 min) in the future and at most 3153600000s (100 years). [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__) MUST be set if [rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getRotationPeriod__) is set. |
| `↳ rotation_period` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Input only. The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If [rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getRotationPeriod__) is set, [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__) must be set. [next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__) will be advanced by this period when the service automatically sends rotation notifications. |

### getNextRotationTime

Optional. Timestamp in UTC at which the
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is scheduled to rotate.

Cannot be set to less than 300s (5 min) in the future and at most
3153600000s (100 years).
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__)
MUST be set if
[rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getRotationPeriod__)
is set.

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

### hasNextRotationTime

### clearNextRotationTime

### setNextRotationTime

Optional. Timestamp in UTC at which the
[Secret](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Secret) is scheduled to rotate.

Cannot be set to less than 300s (5 min) in the future and at most
3153600000s (100 years).
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__)
MUST be set if
[rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getRotationPeriod__)
is set.

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

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

### getRotationPeriod

Input only. The Duration between rotation notifications. Must be in seconds
and at least 3600s (1h) and at most 3153600000s (100 years).

If
[rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getRotationPeriod__)
is set,
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__)
must be set.
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__)
will be advanced by this period when the service automatically sends
rotation notifications.

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

### hasRotationPeriod

### clearRotationPeriod

### setRotationPeriod

Input only. The Duration between rotation notifications. Must be in seconds
and at least 3600s (1h) and at most 3153600000s (100 years).

If
[rotation_period](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getRotationPeriod__)
is set,
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__)
must be set.
[next_rotation_time](https://docs.cloud.google.com/php/docs/reference/cloud-secret-manager/latest/V1beta2.Rotation#_Google_Cloud_SecretManager_V1beta2_Rotation__getNextRotationTime__)
will be advanced by this period when the service automatically sends
rotation notifications.

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

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