# Secret Manager V1BETA2 API - Class Google::Cloud::SecretManager::V1beta2::Rotation (v0.8.0)

0.8.0 (latest) 0.7.1 0.6.0 0.5.1 0.4.0 0.3.1 0.2.0 0.1.1 Reference documentation and code samples for the Secret Manager V1BETA2 API class Google::Cloud::SecretManager::V1beta2::Rotation.

The rotation time and period for a
[Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)"). 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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret#Google__Cloud__SecretManager__V1beta2__Secret_topics_instance_ "Google::Cloud::SecretManager::V1beta2::Secret#topics (method)")
must be set to configure rotation.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #next_rotation_time

    def next_rotation_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-Timestamp)) --- Optional. Timestamp in UTC at which the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") 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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  MUST be set if
  [rotation_period](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_rotation_period_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period (method)")
  is set.

### #next_rotation_time=

    def next_rotation_time=(value) -> ::Google::Protobuf::Timestamp

**Parameter**

- **value** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-Timestamp)) --- Optional. Timestamp in UTC at which the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") 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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  MUST be set if
  [rotation_period](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_rotation_period_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period (method)")
  is set.
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Protobuf-Timestamp)) --- Optional. Timestamp in UTC at which the [Secret](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Secret "Google::Cloud::SecretManager::V1beta2::Secret (class)") 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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  MUST be set if
  [rotation_period](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_rotation_period_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period (method)")
  is set.

### #rotation_period

    def rotation_period() -> ::Google::Protobuf::Duration

**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_rotation_period_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period (method)")
  is set,
  [next_rotation_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  must be set.
  [next_rotation_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  will be advanced by this period when the service automatically sends
  rotation notifications.

### #rotation_period=

    def rotation_period=(value) -> ::Google::Protobuf::Duration

**Parameter**

- **value** ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_rotation_period_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period (method)")
  is set,
  [next_rotation_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  must be set.
  [next_rotation_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  will be advanced by this period when the service automatically sends
  rotation notifications.
**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/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/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_rotation_period_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#rotation_period (method)")
  is set,
  [next_rotation_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  must be set.
  [next_rotation_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta2/latest/Google-Cloud-SecretManager-V1beta2-Rotation#Google__Cloud__SecretManager__V1beta2__Rotation_next_rotation_time_instance_ "Google::Cloud::SecretManager::V1beta2::Rotation#next_rotation_time (method)")
  will be advanced by this period when the service automatically sends
  rotation notifications.