<?php

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

namespace Twilio\Rest\Api\V2010\Account;

use Twilio\Options;
use Twilio\Values;

abstract class MessageOptions {
    /**
     * @param string $from The phone number that initiated the message
     * @param string $messagingServiceSid The 34 character unique id of the
     *                                    Messaging Service you want to associate
     *                                    with this Message.
     * @param string $body The text of the message you want to send, limited to
     *                     1600 characters.
     * @param string $mediaUrl The URL of the media you wish to send out with the
     *                         message.
     * @param string $statusCallback URL Twilio will request when the status changes
     * @param string $applicationSid The application to use for callbacks
     * @param string $maxPrice The total maximum price up to the fourth decimal in
     *                         US dollars acceptable for the message to be
     *                         delivered.
     * @param boolean $provideFeedback Set this value to true if you are sending
     *                                 messages that have a trackable user action
     *                                 and you intend to confirm delivery of the
     *                                 message using the Message Feedback API.
     * @param integer $validityPeriod The number of seconds that the message can
     *                                remain in a Twilio queue.
     * @param string $maxRate The max_rate
     * @param boolean $forceDelivery The force_delivery
     * @param string $providerSid The provider_sid
     * @param string $contentRetention The content_retention
     * @param string $addressRetention The address_retention
     * @param boolean $smartEncoded The smart_encoded
     * @param string $interactiveData JSON string representing interactive data
     *                                message.
     * @return CreateMessageOptions Options builder
     */
    public static function create($from = Values::NONE, $messagingServiceSid = Values::NONE, $body = Values::NONE, $mediaUrl = Values::NONE, $statusCallback = Values::NONE, $applicationSid = Values::NONE, $maxPrice = Values::NONE, $provideFeedback = Values::NONE, $validityPeriod = Values::NONE, $maxRate = Values::NONE, $forceDelivery = Values::NONE, $providerSid = Values::NONE, $contentRetention = Values::NONE, $addressRetention = Values::NONE, $smartEncoded = Values::NONE, $interactiveData = Values::NONE) {
        return new CreateMessageOptions($from, $messagingServiceSid, $body, $mediaUrl, $statusCallback, $applicationSid, $maxPrice, $provideFeedback, $validityPeriod, $maxRate, $forceDelivery, $providerSid, $contentRetention, $addressRetention, $smartEncoded, $interactiveData);
    }

    /**
     * @param string $to Filter by messages to this number
     * @param string $from Filter by from number
     * @param string $dateSentBefore Filter by date sent
     * @param string $dateSent Filter by date sent
     * @param string $dateSentAfter Filter by date sent
     * @return ReadMessageOptions Options builder
     */
    public static function read($to = Values::NONE, $from = Values::NONE, $dateSentBefore = Values::NONE, $dateSent = Values::NONE, $dateSentAfter = Values::NONE) {
        return new ReadMessageOptions($to, $from, $dateSentBefore, $dateSent, $dateSentAfter);
    }
}

class CreateMessageOptions extends Options {
    /**
     * @param string $from The phone number that initiated the message
     * @param string $messagingServiceSid The 34 character unique id of the
     *                                    Messaging Service you want to associate
     *                                    with this Message.
     * @param string $body The text of the message you want to send, limited to
     *                     1600 characters.
     * @param string $mediaUrl The URL of the media you wish to send out with the
     *                         message.
     * @param string $statusCallback URL Twilio will request when the status changes
     * @param string $applicationSid The application to use for callbacks
     * @param string $maxPrice The total maximum price up to the fourth decimal in
     *                         US dollars acceptable for the message to be
     *                         delivered.
     * @param boolean $provideFeedback Set this value to true if you are sending
     *                                 messages that have a trackable user action
     *                                 and you intend to confirm delivery of the
     *                                 message using the Message Feedback API.
     * @param integer $validityPeriod The number of seconds that the message can
     *                                remain in a Twilio queue.
     * @param string $maxRate The max_rate
     * @param boolean $forceDelivery The force_delivery
     * @param string $providerSid The provider_sid
     * @param string $contentRetention The content_retention
     * @param string $addressRetention The address_retention
     * @param boolean $smartEncoded The smart_encoded
     * @param string $interactiveData JSON string representing interactive data
     *                                message.
     */
    public function __construct($from = Values::NONE, $messagingServiceSid = Values::NONE, $body = Values::NONE, $mediaUrl = Values::NONE, $statusCallback = Values::NONE, $applicationSid = Values::NONE, $maxPrice = Values::NONE, $provideFeedback = Values::NONE, $validityPeriod = Values::NONE, $maxRate = Values::NONE, $forceDelivery = Values::NONE, $providerSid = Values::NONE, $contentRetention = Values::NONE, $addressRetention = Values::NONE, $smartEncoded = Values::NONE, $interactiveData = Values::NONE) {
        $this->options['from'] = $from;
        $this->options['messagingServiceSid'] = $messagingServiceSid;
        $this->options['body'] = $body;
        $this->options['mediaUrl'] = $mediaUrl;
        $this->options['statusCallback'] = $statusCallback;
        $this->options['applicationSid'] = $applicationSid;
        $this->options['maxPrice'] = $maxPrice;
        $this->options['provideFeedback'] = $provideFeedback;
        $this->options['validityPeriod'] = $validityPeriod;
        $this->options['maxRate'] = $maxRate;
        $this->options['forceDelivery'] = $forceDelivery;
        $this->options['providerSid'] = $providerSid;
        $this->options['contentRetention'] = $contentRetention;
        $this->options['addressRetention'] = $addressRetention;
        $this->options['smartEncoded'] = $smartEncoded;
        $this->options['interactiveData'] = $interactiveData;
    }

    /**
     * A Twilio phone number (in [E.164](https://www.twilio.com/docs/glossary/what-e164) format),  [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id) or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) enabled for the type of message you wish to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-codes) purchased from Twilio work here. You cannot (for example) spoof messages from your own cell phone number. *Do not use this parameter if you are using `MessagingServiceSid`.*
     * 
     * @param string $from The phone number that initiated the message
     * @return $this Fluent Builder
     */
    public function setFrom($from) {
        $this->options['from'] = $from;
        return $this;
    }

    /**
     * The 34-character unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with this Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `From` phone number for delivery. *Do not pass this value if you are using `From`.*
     * 
     * @param string $messagingServiceSid The 34 character unique id of the
     *                                    Messaging Service you want to associate
     *                                    with this Message.
     * @return $this Fluent Builder
     */
    public function setMessagingServiceSid($messagingServiceSid) {
        $this->options['messagingServiceSid'] = $messagingServiceSid;
        return $this;
    }

    /**
     * The text of the message you want to send, limited to 1600 characters.
     * 
     * @param string $body The text of the message you want to send, limited to
     *                     1600 characters.
     * @return $this Fluent Builder
     */
    public function setBody($body) {
        $this->options['body'] = $body;
        return $this;
    }

    /**
     * The URL containing the media you wish to send with the message. `gif` , `png` and `jpeg` content is currently supported and will be formatted correctly on the recipient's device. [Other types](https://www.twilio.com/docs/sms/accepted-mime-types) are also accepted by the API. The media size limit is 5MB. If you wish to send more than one image in the message body, please provide multiple `MediaUrl` values in the POST request. You may include up to 10 MediaUrls per message. *Sending images via SMS is currently only possible in the US and Canada*
     * 
     * @param string $mediaUrl The URL of the media you wish to send out with the
     *                         message.
     * @return $this Fluent Builder
     */
    public function setMediaUrl($mediaUrl) {
        $this->options['mediaUrl'] = $mediaUrl;
        return $this;
    }

    /**
     * A URL where Twilio will POST each time your message status changes to one of the following: `queued`, `failed`, `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as some additional parameters including `MessageSid`, `MessageStatus`, and `ErrorCode`(see more details [below](#statuscallback-request-parameters)). If you include this parameter in addition to a `MessagingServiceSid`, Twilio will override the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname – underscores are not allowed.
     * 
     * @param string $statusCallback URL Twilio will request when the status changes
     * @return $this Fluent Builder
     */
    public function setStatusCallback($statusCallback) {
        $this->options['statusCallback'] = $statusCallback;
        return $this;
    }

    /**
     * Twilio will POST a `MessageSid` as well as `MessageStatus=sent` or `MessageStatus=failed` to the URL in the `MessageStatusCallback` property of this [application](https://www.twilio.com/docs/usage/api/applications). If the `StatusCallback` parameter is also passed, the application's `MessageStatusCallback` parameter will take precedence.
     * 
     * @param string $applicationSid The application to use for callbacks
     * @return $this Fluent Builder
     */
    public function setApplicationSid($applicationSid) {
        $this->options['applicationSid'] = $applicationSid;
        return $this;
    }

    /**
     * The total maximum price up to the fourth decimal (0.0001) in US dollars acceptable for the message to be delivered. *All messages will be queued for delivery regardless of the price point.* A POST request will later be made to your Status Callback URL with a status change of `Sent` or `Failed`. When the price of the message is greater than this value, the message will fail and not be sent. When `MaxPrice` is not set, all prices for the message are accepted.
     * 
     * @param string $maxPrice The total maximum price up to the fourth decimal in
     *                         US dollars acceptable for the message to be
     *                         delivered.
     * @return $this Fluent Builder
     */
    public function setMaxPrice($maxPrice) {
        $this->options['maxPrice'] = $maxPrice;
        return $this;
    }

    /**
     * Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the [Message Feedback API](https://www.twilio.com/docs/sms/api/message-feedback). This parameter is `false` by default.
     * 
     * @param boolean $provideFeedback Set this value to true if you are sending
     *                                 messages that have a trackable user action
     *                                 and you intend to confirm delivery of the
     *                                 message using the Message Feedback API.
     * @return $this Fluent Builder
     */
    public function setProvideFeedback($provideFeedback) {
        $this->options['provideFeedback'] = $provideFeedback;
        return $this;
    }

    /**
     * The number of seconds that the message can remain in a Twilio queue. After exceeding this time limit, the message will fail and a POST request will later be made to your Status Callback URL. Valid values are between 1 and 14400 seconds (the default). Please note that Twilio cannot guarantee that a message will not be queued by the carrier after they accept the message. We do not recommend setting validity periods of less than 5 seconds.
     * 
     * @param integer $validityPeriod The number of seconds that the message can
     *                                remain in a Twilio queue.
     * @return $this Fluent Builder
     */
    public function setValidityPeriod($validityPeriod) {
        $this->options['validityPeriod'] = $validityPeriod;
        return $this;
    }

    /**
     * The max_rate
     * 
     * @param string $maxRate The max_rate
     * @return $this Fluent Builder
     */
    public function setMaxRate($maxRate) {
        $this->options['maxRate'] = $maxRate;
        return $this;
    }

    /**
     * The force_delivery
     * 
     * @param boolean $forceDelivery The force_delivery
     * @return $this Fluent Builder
     */
    public function setForceDelivery($forceDelivery) {
        $this->options['forceDelivery'] = $forceDelivery;
        return $this;
    }

    /**
     * The provider_sid
     * 
     * @param string $providerSid The provider_sid
     * @return $this Fluent Builder
     */
    public function setProviderSid($providerSid) {
        $this->options['providerSid'] = $providerSid;
        return $this;
    }

    /**
     * The content_retention
     * 
     * @param string $contentRetention The content_retention
     * @return $this Fluent Builder
     */
    public function setContentRetention($contentRetention) {
        $this->options['contentRetention'] = $contentRetention;
        return $this;
    }

    /**
     * The address_retention
     * 
     * @param string $addressRetention The address_retention
     * @return $this Fluent Builder
     */
    public function setAddressRetention($addressRetention) {
        $this->options['addressRetention'] = $addressRetention;
        return $this;
    }

    /**
     * The smart_encoded
     * 
     * @param boolean $smartEncoded The smart_encoded
     * @return $this Fluent Builder
     */
    public function setSmartEncoded($smartEncoded) {
        $this->options['smartEncoded'] = $smartEncoded;
        return $this;
    }

    /**
     * A JSON string that represents interactive message which is a category of messages including list picker, time picker, and an Apple Pay request.
     * 
     * @param string $interactiveData JSON string representing interactive data
     *                                message.
     * @return $this Fluent Builder
     */
    public function setInteractiveData($interactiveData) {
        $this->options['interactiveData'] = $interactiveData;
        return $this;
    }

    /**
     * Provide a friendly representation
     * 
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.Api.V2010.CreateMessageOptions ' . implode(' ', $options) . ']';
    }
}

class ReadMessageOptions extends Options {
    /**
     * @param string $to Filter by messages to this number
     * @param string $from Filter by from number
     * @param string $dateSentBefore Filter by date sent
     * @param string $dateSent Filter by date sent
     * @param string $dateSentAfter Filter by date sent
     */
    public function __construct($to = Values::NONE, $from = Values::NONE, $dateSentBefore = Values::NONE, $dateSent = Values::NONE, $dateSentAfter = Values::NONE) {
        $this->options['to'] = $to;
        $this->options['from'] = $from;
        $this->options['dateSentBefore'] = $dateSentBefore;
        $this->options['dateSent'] = $dateSent;
        $this->options['dateSentAfter'] = $dateSentAfter;
    }

    /**
     * Only show messages to this phone number.
     * 
     * @param string $to Filter by messages to this number
     * @return $this Fluent Builder
     */
    public function setTo($to) {
        $this->options['to'] = $to;
        return $this;
    }

    /**
     * Only show messages from this phone number or alphanumeric sender ID.
     * 
     * @param string $from Filter by from number
     * @return $this Fluent Builder
     */
    public function setFrom($from) {
        $this->options['from'] = $from;
        return $this;
    }

    /**
     * Only show messages sent on this date (in [GMT](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) format), given as `YYYY-MM-DD`. Example: `DateSent=2009-07-06`. You can also specify inequality, such as `DateSent<=YYYY-MM-DD` for messages that were sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` for messages sent on or after midnight on a date.
     * 
     * @param string $dateSentBefore Filter by date sent
     * @return $this Fluent Builder
     */
    public function setDateSentBefore($dateSentBefore) {
        $this->options['dateSentBefore'] = $dateSentBefore;
        return $this;
    }

    /**
     * Only show messages sent on this date (in [GMT](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) format), given as `YYYY-MM-DD`. Example: `DateSent=2009-07-06`. You can also specify inequality, such as `DateSent<=YYYY-MM-DD` for messages that were sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` for messages sent on or after midnight on a date.
     * 
     * @param string $dateSent Filter by date sent
     * @return $this Fluent Builder
     */
    public function setDateSent($dateSent) {
        $this->options['dateSent'] = $dateSent;
        return $this;
    }

    /**
     * Only show messages sent on this date (in [GMT](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) format), given as `YYYY-MM-DD`. Example: `DateSent=2009-07-06`. You can also specify inequality, such as `DateSent<=YYYY-MM-DD` for messages that were sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` for messages sent on or after midnight on a date.
     * 
     * @param string $dateSentAfter Filter by date sent
     * @return $this Fluent Builder
     */
    public function setDateSentAfter($dateSentAfter) {
        $this->options['dateSentAfter'] = $dateSentAfter;
        return $this;
    }

    /**
     * Provide a friendly representation
     * 
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.Api.V2010.ReadMessageOptions ' . implode(' ', $options) . ']';
    }
}