# Cloud Firestore Admin V1 API - Class Google::Cloud::Firestore::Admin::V1::Field::TtlConfig (v1.13.0)

1.13.0 (latest) 1.12.1 1.11.0 1.10.0 1.9.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.1 1.3.0 1.2.0 1.1.0 1.0.1 0.18.0 0.17.1 0.16.0 0.15.0 0.14.3 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.5 Reference documentation and code samples for the Cloud Firestore Admin V1 API class Google::Cloud::Firestore::Admin::V1::Field::TtlConfig.

The TTL (time-to-live) configuration for documents that have this `Field`
set.


A timestamp stored in a TTL-enabled field will be used to determine the
expiration time of the document. The expiration time is the sum
of the timestamp value and the `expiration_offset`.

For Enterprise edition databases, the timestamp value may alternatively be
stored in an array value in the TTL-enabled field.

<br />

An expiration time in the past indicates that the document is eligible for
immediate expiration. Using any other data type or leaving the field absent
will disable expiration for the individual document.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #expiration_offset

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

**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest/Google-Protobuf-Duration)) --- Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time.


  `expiration_offset.seconds` must be between 0 and 2,147,483,647
  inclusive. Values more precise than seconds are rejected.

  If unset, defaults to 0, in which case the expiration time is the same
  as the timestamp value from the TTL-enabled field.

### #expiration_offset=

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

**Parameter**

- **value** ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest/Google-Protobuf-Duration)) --- Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time.


  `expiration_offset.seconds` must be between 0 and 2,147,483,647
  inclusive. Values more precise than seconds are rejected.

  If unset, defaults to 0, in which case the expiration time is the same
  as the timestamp value from the TTL-enabled field.
**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest/Google-Protobuf-Duration)) --- Optional. The offset, relative to the timestamp value from the TTL-enabled field, used to determine the document's expiration time.


  `expiration_offset.seconds` must be between 0 and 2,147,483,647
  inclusive. Values more precise than seconds are rejected.

  If unset, defaults to 0, in which case the expiration time is the same
  as the timestamp value from the TTL-enabled field.

### #state

    def state() -> ::Google::Cloud::Firestore::Admin::V1::Field::TtlConfig::State

**Returns**

- ([::Google::Cloud::Firestore::Admin::V1::Field::TtlConfig::State](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-admin-v1/latest/Google-Cloud-Firestore-Admin-V1-Field-TtlConfig-State)) --- Output only. The state of the TTL configuration.