Q:

How to provide an expiration time for a subscription in Google Cloud PubSub

I'm trying to set an expiration time for a subscription. 
This is how options looks like as suggested by the official docs:
https://cloud.google.com/nodejs/docs/reference/pubsub/0.28.x/global#CreateSubscriptionRequest
https://cloud.google.com/nodejs/docs/reference/pubsub/0.28.x/global#ExpirationPolicy 
let options = {
  expirationPolicy: {
    ttl: '86400s',
  },
};

Then I got .google.pubsub.v1.ExpirationPolicy.ttl: object expected error.
So I tried having an object inside property ttl then I got the following error: The value for 0 is too small. You passed expiration duration in the request, but the minimum value is 24h.
I'm unable to find the correct format to this.
I'm on @google-cloud/pubsub@0.28.1 and tried upgrading to @google-cloud/pubsub@0.29.1. No luck.
Anyone has experienced this before or know the correct format for expirationPolicy?

A:

The expirationPolicy ttl needs to be specified as an object with the seconds field as an integer:
let options = {
  expirationPolicy: {
    ttl: {
      seconds: 86400
    }
  }
};

This is inconsistent with the documentation, so I have created a GitHub issue to track the inconsistency.

