<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Rest\Verify\V2\Service\Entity\Challenge;

use Twilio\Options;
use Twilio\Values;

/**
 * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
 */
abstract class NotificationOptions {
    /**
     * @param int $ttl How long, in seconds, the Notification is valid.
     * @return CreateNotificationOptions Options builder
     */
    public static function create(int $ttl = Values::NONE): CreateNotificationOptions {
        return new CreateNotificationOptions($ttl);
    }
}

class CreateNotificationOptions extends Options {
    /**
     * @param int $ttl How long, in seconds, the Notification is valid.
     */
    public function __construct(int $ttl = Values::NONE) {
        $this->options['ttl'] = $ttl;
    }

    /**
     * How long, in seconds, the Notification is valid. Delivery will be attempted if the device is offline until the TTL elapses. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. Must be an integer between 0 and 300 seconds, inclusive. Defaults to 300 seconds.
     *
     * @param int $ttl How long, in seconds, the Notification is valid.
     * @return $this Fluent Builder
     */
    public function setTtl(int $ttl): self {
        $this->options['ttl'] = $ttl;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString(): string {
        $options = \http_build_query(Values::of($this->options), '', ' ');
        return '[Twilio.Verify.V2.CreateNotificationOptions ' . $options . ']';
    }
}